Class: Loquor::Client
- Inherits:
-
Object
- Object
- Loquor::Client
- Defined in:
- lib/loquor/client.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #delete(url) ⇒ Object
- #get(url, options = {}) ⇒ Object
-
#initialize ⇒ Client
constructor
A new instance of Client.
- #post(url, payload) ⇒ Object
- #put(url, payload) ⇒ Object
Constructor Details
#initialize ⇒ Client
Returns a new instance of Client.
5 6 7 |
# File 'lib/loquor/client.rb', line 5 def initialize @config = Configuration.new end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
3 4 5 |
# File 'lib/loquor/client.rb', line 3 def config @config end |
Instance Method Details
#delete(url) ⇒ Object
25 26 27 28 |
# File 'lib/loquor/client.rb', line 25 def delete(url) deps = {config: @config} HttpAction::Delete.delete(url, deps) end |
#get(url, options = {}) ⇒ Object
9 10 11 12 13 |
# File 'lib/loquor/client.rb', line 9 def get(url, = {}) deps = {config: @config} deps[:should_cache] = [:cache] if [:cache] HttpAction::Get.get(url, deps) end |
#post(url, payload) ⇒ Object
20 21 22 23 |
# File 'lib/loquor/client.rb', line 20 def post(url, payload) deps = {config: @config} HttpAction::Post.post(url, payload, deps) end |
#put(url, payload) ⇒ Object
15 16 17 18 |
# File 'lib/loquor/client.rb', line 15 def put(url, payload) deps = {config: @config} HttpAction::Put.put(url, payload, deps) end |