Class: NewEden::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/new_eden/client.rb

Constant Summary collapse

BASE_URL =
'https://api.eveonline.com'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) {|_self| ... } ⇒ Client

Returns a new instance of Client.

Yields:

  • (_self)

Yield Parameters:



15
16
17
18
19
20
# File 'lib/new_eden/client.rb', line 15

def initialize(options = {})
  options.each do |key, value|
    instance_variable_set("@#{key}", value)
  end
  yield(self) if block_given?
end

Instance Attribute Details

#keyIdObject

Returns the value of attribute keyId.



13
14
15
# File 'lib/new_eden/client.rb', line 13

def keyId
  @keyId
end

#vCodeObject

Returns the value of attribute vCode.



14
15
16
# File 'lib/new_eden/client.rb', line 14

def vCode
  @vCode
end

Instance Method Details

#accountObject



34
35
36
# File 'lib/new_eden/client.rb', line 34

def 
  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, options = {})
  url = Addressable::URI.parse(BASE_URL + uri)
  options.merge!(auth_params)
  url.query_values = options
  resp = Net::HTTP.get(URI(url.to_s))
  return Hash.from_xml(resp)
end

#mapObject



30
31
32
# File 'lib/new_eden/client.rb', line 30

def map
  return NewEden::API::Map.new(self)
end