Module: JustimmoClient::API
- Included in:
- JustimmoClient, V1::JustimmoInterface
- Defined in:
- lib/justimmo_client/core/api_helpers.rb
Instance Method Summary collapse
- #api(name) ⇒ Object
- #interface(name) ⇒ Object
- #model(name) ⇒ Object
- #representer(name, type = :xml) ⇒ Object
- #request(name) ⇒ Object
- #versioned_api(*name) ⇒ Object
Instance Method Details
#api(name) ⇒ Object
9 10 11 |
# File 'lib/justimmo_client/core/api_helpers.rb', line 9 def api(name) "JustimmoClient::#{name.to_s.classify}".constantize end |
#interface(name) ⇒ Object
25 26 27 |
# File 'lib/justimmo_client/core/api_helpers.rb', line 25 def interface(name) versioned_api("#{name.to_s.classify}Interface") end |
#model(name) ⇒ Object
17 18 19 |
# File 'lib/justimmo_client/core/api_helpers.rb', line 17 def model(name) versioned_api(name.to_s.classify) end |
#representer(name, type = :xml) ⇒ Object
13 14 15 |
# File 'lib/justimmo_client/core/api_helpers.rb', line 13 def representer(name, type = :xml) versioned_api(type.to_s.classify, "#{name.to_s.classify}Representer") end |
#request(name) ⇒ Object
21 22 23 |
# File 'lib/justimmo_client/core/api_helpers.rb', line 21 def request(name) versioned_api("#{name.to_s.classify}Request") end |
#versioned_api(*name) ⇒ Object
5 6 7 |
# File 'lib/justimmo_client/core/api_helpers.rb', line 5 def versioned_api(*name) (["JustimmoClient::V#{JustimmoClient::Config.api_ver}"] + name).join("::").constantize end |