Class: Masheri::RpcClient
- Inherits:
-
Object
- Object
- Masheri::RpcClient
- Defined in:
- lib/masheri/rpc_client.rb
Instance Method Summary collapse
- #call_remote(method, opts = {}) ⇒ Object
- #config ⇒ Object
-
#create(type, params) ⇒ Object
Create an object.
-
#echo(value) ⇒ Object
Test Mashery API with echo service.
-
#query(string) ⇒ Object
Use the Mashery query language to grab data.
- #query_builder(klass) ⇒ Object
Instance Method Details
#call_remote(method, opts = {}) ⇒ Object
103 104 105 |
# File 'lib/masheri/rpc_client.rb', line 103 def call_remote(method, opts = {}) perform('method' => method, 'params' => Array(opts[:params]), 'id' => 1) end |
#create(type, params) ⇒ Object
Create an object
98 99 100 101 |
# File 'lib/masheri/rpc_client.rb', line 98 def create(type, params) # TODO: Handle params! call_remote [type_name, "create"].join('.') end |
#echo(value) ⇒ Object
Test Mashery API with echo service
84 85 86 |
# File 'lib/masheri/rpc_client.rb', line 84 def echo(value) call_remote('test.echo', value) end |
#query(string) ⇒ Object
Use the Mashery query language to grab data
93 94 95 |
# File 'lib/masheri/rpc_client.rb', line 93 def query(string) call_remote("object.query", params: string) end |
#query_builder(klass) ⇒ Object
88 89 90 |
# File 'lib/masheri/rpc_client.rb', line 88 def query_builder(klass) Masheri::QueryBuilder.new(klass) end |