Class: Lightspeed::Accounts

Inherits:
Collection show all
Defined in:
lib/lightspeed/accounts.rb

Constant Summary

Constants inherited from Collection

Collection::PER_PAGE

Instance Attribute Summary

Attributes inherited from Collection

#context, #resources

Instance Method Summary collapse

Methods inherited from Collection

#all, #all_loaded, #as_json, #client, collection_name, #create, #destroy, #each, #each_loaded, #each_page, #enum, #enum_page, #find, #first, #first_loaded, #initialize, #inspect, #load_relations_default, resource_class, resource_name, #size, #size_loaded, #to_json, #unload, #update

Constructor Details

This class inherits a constructor from Lightspeed::Collection

Instance Method Details

#accountObject



10
11
12
# File 'lib/lightspeed/accounts.rb', line 10

def 
  first_loaded || first
end

#base_pathObject



6
7
8
# File 'lib/lightspeed/accounts.rb', line 6

def base_path
  '/Account'
end

#page(n, *args) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/lightspeed/accounts.rb', line 14

def page(n, *args)
  # turns out lightspeed doesn't respect pagination for accounts.
  # so page(1) is identical to page(0).
  # they should be different, thus.
  # if someone has more than 100 store accounts, well, good for them.
  n.zero? ? super : []
end