Class: Memoir::TimePeriod
- Inherits:
-
Object
- Object
- Memoir::TimePeriod
- Defined in:
- lib/memoir/time_period.rb
Instance Attribute Summary collapse
-
#interval ⇒ Object
Returns the value of attribute interval.
-
#units ⇒ Object
Returns the value of attribute units.
Instance Method Summary collapse
-
#initialize(interval, units) ⇒ TimePeriod
constructor
A new instance of TimePeriod.
- #to_s ⇒ Object
Constructor Details
#initialize(interval, units) ⇒ TimePeriod
Returns a new instance of TimePeriod.
4 5 6 7 |
# File 'lib/memoir/time_period.rb', line 4 def initialize(interval, units) @interval = interval @units = units end |
Instance Attribute Details
#interval ⇒ Object
Returns the value of attribute interval.
2 3 4 |
# File 'lib/memoir/time_period.rb', line 2 def interval @interval end |
#units ⇒ Object
Returns the value of attribute units.
2 3 4 |
# File 'lib/memoir/time_period.rb', line 2 def units @units end |
Instance Method Details
#to_s ⇒ Object
9 10 11 |
# File 'lib/memoir/time_period.rb', line 9 def to_s "#{interval}#{units}" end |