method

build

Importance_1
v6.0.0 - Show latest stable - 0 notes - Class: ActiveSupport::Duration
build(value) public

Creates a new Duration from a seconds value that is converted to the individual parts:

ActiveSupport::Duration.build(31556952).parts # => {:years=>1}
ActiveSupport::Duration.build(2716146).parts  # => {:months=>1, :days=>1}
Show source
Register or log in to add new notes.