Class: Memoir::TimePeriod

Inherits:
Object
  • Object
show all
Defined in:
lib/memoir/time_period.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#intervalObject

Returns the value of attribute interval.



2
3
4
# File 'lib/memoir/time_period.rb', line 2

def interval
  @interval
end

#unitsObject

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_sObject



9
10
11
# File 'lib/memoir/time_period.rb', line 9

def to_s
  "#{interval}#{units}"
end