Class: TheCity::GroupExport

Inherits:
ApiObject show all
Defined in:
lib/api/group_export.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 = nil) ⇒ GroupExport

Constructor.

Parameters:

  • json_data (optional) (defaults to: nil)

    JSON data of the group export.



32
33
34
35
# File 'lib/api/group_export.rb', line 32

def initialize(json_data = nil)
  @writer_object = GroupExportWriter
  initialize_from_json_object(json_data) unless json_data.nil?
end

Class Method Details

.load_by_id(group_export_id, options = {}) ⇒ Object

Loads the group export by the specified ID.

Returns a new TheCity::GroupExport object.

Parameters:

  • group_export_id

    The ID of the group export to load.

  • options (defaults to: {})

    A hash of options for requesting data from the server.

    group_id is required

    user_type is optional. It can be “Users” or “OfflineUsers”



21
22
23
24
25
26
# File 'lib/api/group_export.rb', line 21

def self.load_by_id(group_export_id, options = {})
  group_reader = GroupExportReader.new(group_export_id, options)
  self.new(group_reader.load_feed)
rescue
  nil        
end