Class: TheCity::Group
Instance Attribute Summary
Attributes inherited from ApiObject
#error_messages, #marked_for_destruction
Class Method Summary collapse
-
.load_group_by_id(group_id, options = {}) ⇒ Object
Loads the group by the specified ID.
Instance Method Summary collapse
-
#addresses(force_reload = false) ⇒ GroupAddressList
The address information.
-
#checkins(force_reload = false) ⇒ GroupCheckinList
The checkin information.
-
#event_attendances(force_reload = false) ⇒ GroupEventAttendanceList
The checkin information.
-
#exports(force_reload = false) ⇒ GroupExportList
The checkin information.
-
#initialize(reader = nil) ⇒ Group
constructor
Constructor.
-
#invitations(force_reload = false) ⇒ GroupInvitationList
The invitations for this group.
-
#roles(force_reload = false) ⇒ GroupRoleList
The roles for this group.
-
#tags(force_reload = false) ⇒ GroupTagList
The tags for this group.
Methods inherited from ApiObject
__tc_attributes, #delete, #initialize_from_json_object, #is_deleted?, #save, #set_attributes, tc_attr_accessor, #to_attributes
Constructor Details
#initialize(reader = nil) ⇒ Group
Constructor.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/api/group.rb', line 52 def initialize(reader = nil) if reader.is_a?(GroupReader) initialize_from_json_object(reader.load_feed) elsif reader.is_a?(Hash) initialize_from_json_object(reader) end @writer_object = GroupWriter @address_list = nil @checkin_list = nil @event_attendance_list = nil @export_list = nil @invitations = nil @role_list = nil @tag_list = nil end |
Class Method Details
.load_group_by_id(group_id, options = {}) ⇒ Object
Loads the group by the specified ID.
Returns a new TheCity::Group object.
42 43 44 45 |
# File 'lib/api/group.rb', line 42 def self.load_group_by_id(group_id, = {}) group_reader = GroupReader.new(group_id, ) self.new(group_reader) end |
Instance Method Details
#addresses(force_reload = false) ⇒ GroupAddressList
The address information.
73 74 75 76 77 78 79 80 81 |
# File 'lib/api/group.rb', line 73 def addresses(force_reload = false) unless force_reload return @address_list unless @address_list.nil? end return nil unless self.id @address_list = GroupAddressList.new({:group_id => self.id}) return @address_list end |
#checkins(force_reload = false) ⇒ GroupCheckinList
The checkin information.
87 88 89 90 91 92 93 94 95 |
# File 'lib/api/group.rb', line 87 def checkins(force_reload = false) unless force_reload return @checkin_list unless @checkin_list.nil? end return nil unless self.id @checkin_list = GroupCheckinList.new({:group_id => self.id}) return @checkin_list end |
#event_attendances(force_reload = false) ⇒ GroupEventAttendanceList
The checkin information.
115 116 117 118 119 120 121 122 123 |
# File 'lib/api/group.rb', line 115 def event_attendances(force_reload = false) unless force_reload return @event_attendance_list unless @event_attendance_list.nil? end return nil unless self.id @event_attendance_list = GroupEventAttendanceList.new({:group_id => self.id}) return @event_attendance_list end |
#exports(force_reload = false) ⇒ GroupExportList
The checkin information.
101 102 103 104 105 106 107 108 109 |
# File 'lib/api/group.rb', line 101 def exports(force_reload = false) unless force_reload return @export_list unless @export_list.nil? end return nil unless self.id @export_list = GroupExportList.new({:group_id => self.id}) return @export_list end |
#invitations(force_reload = false) ⇒ GroupInvitationList
The invitations for this group.
129 130 131 132 133 134 135 136 137 |
# File 'lib/api/group.rb', line 129 def invitations(force_reload = false) unless force_reload return @invitation_list unless @invitation_list.nil? end return nil unless self.id @invitation_list = GroupInvitationList.new({:group_id => self.id}) return @invitation_list end |
#roles(force_reload = false) ⇒ GroupRoleList
The roles for this group.
143 144 145 146 147 148 149 150 151 |
# File 'lib/api/group.rb', line 143 def roles(force_reload = false) unless force_reload return @role_list unless @role_list.nil? end return nil unless self.id @role_list = GroupRoleList.new({:group_id => self.id}) return @role_list end |
#tags(force_reload = false) ⇒ GroupTagList
The tags for this group.
157 158 159 160 161 162 163 164 165 |
# File 'lib/api/group.rb', line 157 def (force_reload = false) unless force_reload return @tag_list unless @tag_list.nil? end return nil unless self.id @tag_list = GroupTagList.new({:group_id => self.id}) return @tag_list end |