Class: Gaah::Calendar::Calendar

Inherits:
ApiModel
  • Object
show all
Defined in:
lib/gaah/calendar/calendar.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModel

#==, batch_create

Constructor Details

#initialize(json) ⇒ Calendar

Returns a new instance of Calendar.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/gaah/calendar/calendar.rb', line 6

def initialize(json)
  store_json(json)

  @id          = json['id']
  @summary     = json['summary']
  @description = json['description']
  @hidden      = json['hidden']
  @selected    = json['selected']
  @primary     = json['primary']
  @time_zone   = json['timeZone']
  @color_id    = json['colorId']
  @bg_color    = json['backgroundColor']
  @fg_color    = json['foregroundColor']
  @access_role = json['accessRole']
end

Instance Attribute Details

#access_roleObject (readonly)

Returns the value of attribute access_role.



4
5
6
# File 'lib/gaah/calendar/calendar.rb', line 4

def access_role
  @access_role
end

#bg_colorObject (readonly)

Returns the value of attribute bg_color.



4
5
6
# File 'lib/gaah/calendar/calendar.rb', line 4

def bg_color
  @bg_color
end

#color_idObject (readonly)

Returns the value of attribute color_id.



4
5
6
# File 'lib/gaah/calendar/calendar.rb', line 4

def color_id
  @color_id
end

#descriptionObject (readonly)

Returns the value of attribute description.



4
5
6
# File 'lib/gaah/calendar/calendar.rb', line 4

def description
  @description
end

#fg_colorObject (readonly)

Returns the value of attribute fg_color.



4
5
6
# File 'lib/gaah/calendar/calendar.rb', line 4

def fg_color
  @fg_color
end

#hiddenObject (readonly)

Returns the value of attribute hidden.



4
5
6
# File 'lib/gaah/calendar/calendar.rb', line 4

def hidden
  @hidden
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/gaah/calendar/calendar.rb', line 4

def id
  @id
end

#primaryObject (readonly)

Returns the value of attribute primary.



4
5
6
# File 'lib/gaah/calendar/calendar.rb', line 4

def primary
  @primary
end

#selectedObject (readonly)

Returns the value of attribute selected.



4
5
6
# File 'lib/gaah/calendar/calendar.rb', line 4

def selected
  @selected
end

#summaryObject (readonly)

Returns the value of attribute summary.



4
5
6
# File 'lib/gaah/calendar/calendar.rb', line 4

def summary
  @summary
end

#time_zoneObject (readonly)

Returns the value of attribute time_zone.



4
5
6
# File 'lib/gaah/calendar/calendar.rb', line 4

def time_zone
  @time_zone
end

Instance Method Details

#marshal_dumpObject



38
39
40
# File 'lib/gaah/calendar/calendar.rb', line 38

def marshal_dump
  [@id, @summary, @description, @hidden, @selected, @primary, @time_zone, @color_id, @bg_color, @fg_color, @access_role]
end

#marshal_load(array) ⇒ Object



42
43
44
# File 'lib/gaah/calendar/calendar.rb', line 42

def marshal_load(array)
  @id, @summary, @description, @hidden, @selected, @primary, @time_zone, @color_id, @bg_color, @fg_color, @access_role = array
end

#to_json(*args) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/gaah/calendar/calendar.rb', line 22

def to_json(*args)
  {
    id:          @id,
    summary:     @summary,
    description: @description,
    hidden:      @hidden,
    selected:    @selected,
    primary:     @primary,
    time_zone:   @time_zone,
    color_id:    @color_id,
    bg_color:    @bg_color,
    fg_color:    @fg_color,
    access_role: @access_role,
  }.to_json
end