Class: Mashery::RpcClient::Base
- Inherits:
-
Object
- Object
- Mashery::RpcClient::Base
- Defined in:
- lib/mashery/rpc_client/base.rb
Class Method Summary collapse
- .all ⇒ Object
- .count ⇒ Object
- .find_each(&block) ⇒ Object
- .first ⇒ Object
- .items(argument) ⇒ Object
- .page(argument) ⇒ Object
- .select(argument) ⇒ Object
- .where(argument) ⇒ Object
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(attributes) ⇒ Base
Returns a new instance of Base.
4 5 6 7 8 |
# File 'lib/mashery/rpc_client/base.rb', line 4 def initialize(attributes) attributes.each do |key, value| send("#{key}=", value) end end |
Class Method Details
.all ⇒ Object
14 15 16 |
# File 'lib/mashery/rpc_client/base.rb', line 14 def self.all default_query.all end |
.count ⇒ Object
10 11 12 |
# File 'lib/mashery/rpc_client/base.rb', line 10 def self.count default_query.items(1).to_json["result"]["total_items"] end |
.find_each(&block) ⇒ Object
34 35 36 |
# File 'lib/mashery/rpc_client/base.rb', line 34 def self.find_each(&block) default_query.find_each(&block) end |
.first ⇒ Object
38 39 40 |
# File 'lib/mashery/rpc_client/base.rb', line 38 def self.first new(standard_query.items(1).all.items[0]) end |
.items(argument) ⇒ Object
22 23 24 |
# File 'lib/mashery/rpc_client/base.rb', line 22 def self.items(argument) default_query.items(argument) end |
.page(argument) ⇒ Object
30 31 32 |
# File 'lib/mashery/rpc_client/base.rb', line 30 def self.page(argument) default_query.page(argument) end |
.select(argument) ⇒ Object
18 19 20 |
# File 'lib/mashery/rpc_client/base.rb', line 18 def self.select(argument) default_query.select(argument) end |
.where(argument) ⇒ Object
26 27 28 |
# File 'lib/mashery/rpc_client/base.rb', line 26 def self.where(argument) default_query.where(argument) end |