Class: NewEden::Client
- Inherits:
-
Object
- Object
- NewEden::Client
- Defined in:
- lib/new_eden/client.rb
Constant Summary collapse
- BASE_URL =
'https://api.eveonline.com'
Instance Attribute Summary collapse
-
#keyId ⇒ Object
Returns the value of attribute keyId.
-
#vCode ⇒ Object
Returns the value of attribute vCode.
Instance Method Summary collapse
- #account ⇒ Object
- #get(uri, options = {}) ⇒ Object
-
#initialize(options = {}) {|_self| ... } ⇒ Client
constructor
A new instance of Client.
- #map ⇒ Object
Constructor Details
#initialize(options = {}) {|_self| ... } ⇒ Client
Returns a new instance of Client.
15 16 17 18 19 20 |
# File 'lib/new_eden/client.rb', line 15 def initialize( = {}) .each do |key, value| instance_variable_set("@#{key}", value) end yield(self) if block_given? end |
Instance Attribute Details
#keyId ⇒ Object
Returns the value of attribute keyId.
13 14 15 |
# File 'lib/new_eden/client.rb', line 13 def keyId @keyId end |
#vCode ⇒ Object
Returns the value of attribute vCode.
14 15 16 |
# File 'lib/new_eden/client.rb', line 14 def vCode @vCode end |
Instance Method Details
#account ⇒ Object
34 35 36 |
# File 'lib/new_eden/client.rb', line 34 def account return NewEden::API::Account.new(self) end |
#get(uri, options = {}) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/new_eden/client.rb', line 22 def get(uri, = {}) url = Addressable::URI.parse(BASE_URL + uri) .merge!(auth_params) url.query_values = resp = Net::HTTP.get(URI(url.to_s)) return Hash.from_xml(resp) end |