Class: Camdram::Diary::Period

Inherits:
Base
  • Object
show all
Defined in:
lib/camdram/diary.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#id

Instance Method Summary collapse

Methods inherited from Base

#make_orphan

Constructor Details

#initialize(*args) ⇒ Camdram::Diary::Period

Instantiate a new Period object from a JSON hash

Parameters:

  • options (Hash)

    A single JSON hash with symbolized keys.


32
33
34
35
36
# File 'lib/camdram/diary.rb', line 32

def initialize(*args)
  super(*args)
  @start_at = Date.parse(@start_at) unless @start_at.nil?
  @end_at = Date.parse(@end_at) unless @end_at.nil?
end

Instance Attribute Details

#end_atObject

Returns the value of attribute end_at


26
27
28
# File 'lib/camdram/diary.rb', line 26

def end_at
  @end_at
end

#start_atObject

Returns the value of attribute start_at


26
27
28
# File 'lib/camdram/diary.rb', line 26

def start_at
  @start_at
end

#textObject

Returns the value of attribute text


26
27
28
# File 'lib/camdram/diary.rb', line 26

def text
  @text
end