Class: MWO::Client

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

Constant Summary collapse

ITEMS_PATH =
"/api/items/list/full.json"
OMNIPARTS_PATH =
"/api/omniparts/list/full.json"
MECHS_PATH =
"/api/mechs/list/full.json"
MECH_IDS_PATH =
"/api/mechs/list/dict.json"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Client

Returns a new instance of Client.



9
10
11
# File 'lib/mwo/client.rb', line 9

def initialize(args = {})
  @host = args[:host] || "http://static.mwomercs.com"
end

Instance Attribute Details

#hostObject

Returns the value of attribute host.



7
8
9
# File 'lib/mwo/client.rb', line 7

def host
  @host
end

Instance Method Details

#items_urlObject



17
18
19
# File 'lib/mwo/client.rb', line 17

def items_url
  host + ITEMS_PATH
end

#mech_ids_urlObject



25
26
27
# File 'lib/mwo/client.rb', line 25

def mech_ids_url
  host + MECH_IDS_PATH
end

#mechs_urlObject



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

def mechs_url
  host + MECHS_PATH
end

#omniparts_urlObject



21
22
23
# File 'lib/mwo/client.rb', line 21

def omniparts_url
  host + OMNIPARTS_PATH
end