Class: MWO::Client
- Inherits:
-
Object
- Object
- MWO::Client
- 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
-
#host ⇒ Object
Returns the value of attribute host.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Client
constructor
A new instance of Client.
- #items_url ⇒ Object
- #mech_ids_url ⇒ Object
- #mechs_url ⇒ Object
- #omniparts_url ⇒ Object
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
#host ⇒ Object
Returns the value of attribute host.
7 8 9 |
# File 'lib/mwo/client.rb', line 7 def host @host end |
Instance Method Details
#items_url ⇒ Object
17 18 19 |
# File 'lib/mwo/client.rb', line 17 def items_url host + ITEMS_PATH end |
#mech_ids_url ⇒ Object
25 26 27 |
# File 'lib/mwo/client.rb', line 25 def mech_ids_url host + MECH_IDS_PATH end |
#mechs_url ⇒ Object
13 14 15 |
# File 'lib/mwo/client.rb', line 13 def mechs_url host + MECHS_PATH end |
#omniparts_url ⇒ Object
21 22 23 |
# File 'lib/mwo/client.rb', line 21 def omniparts_url host + OMNIPARTS_PATH end |