Class: TheCity::GroupCheckin

Inherits:
ApiObject show all
Defined in:
lib/api/group_checkin.rb

Instance Attribute Summary

Attributes inherited from ApiObject

#error_messages, #marked_for_destruction

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiObject

__tc_attributes, #delete, #initialize_from_json_object, #is_deleted?, #save, #set_attributes, tc_attr_accessor, #to_attributes

Constructor Details

#initialize(json_data) ⇒ GroupCheckin

Constructor.

Parameters:

  • json_data

    JSON data of the group checkin.



27
28
29
# File 'lib/api/group_checkin.rb', line 27

def initialize(json_data)
  initialize_from_json_object(json_data)
end

Class Method Details

.load_by_id(group_id, checkin_id) ⇒ Object

Loads the group_checkin by the specified ID.

Returns a new TheCity::GroupCheckin object.

Parameters:

  • group_id

    The ID of the group to load.

  • checkin_id

    The ID of the group_checkin to load.



37
38
39
40
41
42
# File 'lib/api/group_checkin.rb', line 37

def self.load_by_id(group_id, checkin_id)
  reader = GroupCheckinReader.new(group_id, checkin_id, 'id')
  self.new(reader.load_feed)
rescue
  nil
end