Class: Wego::Client
- Inherits:
-
Object
- Object
- Wego::Client
- Defined in:
- lib/wego/client.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#end_point ⇒ Object
readonly
Returns the value of attribute end_point.
Instance Method Summary collapse
- #get ⇒ Object
-
#initialize(end_point, attributes = {}) ⇒ Client
constructor
A new instance of Client.
- #url ⇒ Object
Constructor Details
#initialize(end_point, attributes = {}) ⇒ Client
Returns a new instance of Client.
9 10 11 12 |
# File 'lib/wego/client.rb', line 9 def initialize(end_point, attributes = {}) @end_point = end_point @attributes = attributes end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
7 8 9 |
# File 'lib/wego/client.rb', line 7 def attributes @attributes end |
#end_point ⇒ Object (readonly)
Returns the value of attribute end_point.
7 8 9 |
# File 'lib/wego/client.rb', line 7 def end_point @end_point end |
Instance Method Details
#get ⇒ Object
14 15 16 |
# File 'lib/wego/client.rb', line 14 def get RestClient.get api_path, params: api_params end |
#url ⇒ Object
18 19 20 21 |
# File 'lib/wego/client.rb', line 18 def url params = api_params.map { |key, value| "#{key}=#{value}" }.join("&") [api_path, params].join("?") end |