Class: TheCity::UserCount

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

Instance Attribute Summary

Attributes inherited from ApiObject

#error_messages, #marked_for_destruction

Instance Method Summary collapse

Methods inherited from ApiObject

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

Constructor Details

#initialize(options = {}) ⇒ UserCount

Constructor.

Options:

:filter - The Reader to use to load the data.

Examples:

UserCount.new

UserCount.new({:filter => :created_in_the_last_7_Days})

Parameters:

  • options (defaults to: {})

    A hash of options for loading the user count.



22
23
24
25
26
27
# File 'lib/api/user_count.rb', line 22

def initialize(options = {})
  reader = options[:reader] || TheCity::UserCountReader.new(options)
  @json_data = reader.load_feed    
  self.count = @json_data['count']
  self.filter = @json_data['filter']
end

Instance Method Details

#deleteObject



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

def delete
  raise 'User count does not have a delete method'
end

#saveObject



29
30
31
# File 'lib/api/user_count.rb', line 29

def save
  raise 'User count does not have a save method'
end