Class: Camdram::Diary

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

Instance Attribute Summary collapse

Attributes included from API

#http

Attributes inherited from Base

#id

Instance Method Summary collapse

Methods included from API

#update!

Constructor Details

#initialize(options = {}) ⇒ Camdram::Event

Instantiate a new Diary object from a JSON hash

Parameters:

  • options (Hash) (defaults to: {})

    A single JSON hash with symbolized keys.



14
15
16
17
# File 'lib/camdram/diary.rb', line 14

def initialize(options = {})
  super(options)
  @events = split_object( @events, Event ) unless @events.nil?
end

Instance Attribute Details

#eventsObject

Returns the value of attribute events.



8
9
10
# File 'lib/camdram/diary.rb', line 8

def events
  @events
end

Instance Method Details

#infoHash

Return a hash of the diary's attributes

Returns:

  • (Hash)

    Hash with symbolized keys.



22
23
24
25
26
# File 'lib/camdram/diary.rb', line 22

def info
  {
    events: events,
  }
end