Class: TimeLord::Time

Inherits:
Object
  • Object
show all
Defined in:
lib/time-lord/time.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(moment) ⇒ Time

Returns a new instance of Time.



5
6
7
# File 'lib/time-lord/time.rb', line 5

def initialize(moment)
  self.moment = moment
end

Instance Attribute Details

#momentObject

Returns the value of attribute moment.



3
4
5
# File 'lib/time-lord/time.rb', line 3

def moment
  @moment
end

Instance Method Details

#periodObject



9
10
11
# File 'lib/time-lord/time.rb', line 9

def period
  Period.new(moment, ::Time.now)
end