Module: Jaxx::ApiMapper::ClassMethods
- Defined in:
- lib/jaxx/api_mapper.rb
Instance Method Summary collapse
- #api_attributes ⇒ Object
- #attribute_via_path(meth, path = nil) ⇒ Object
- #base_path(bp = nil) ⇒ Object
- #host(h = nil) ⇒ Object
Instance Method Details
#api_attributes ⇒ Object
14 15 16 |
# File 'lib/jaxx/api_mapper.rb', line 14 def api_attributes @api_attibutes ||= [] end |
#attribute_via_path(meth, path = nil) ⇒ Object
18 19 20 21 22 |
# File 'lib/jaxx/api_mapper.rb', line 18 def attribute_via_path meth, path = nil path ||= meth.to_s.gsub('_', '-') define_method(meth.to_sym) { make_request path } api_attributes.push(meth.to_sym) end |
#base_path(bp = nil) ⇒ Object
29 30 31 32 |
# File 'lib/jaxx/api_mapper.rb', line 29 def base_path bp = nil @base_path = bp if bp @base_path end |
#host(h = nil) ⇒ Object
24 25 26 27 |
# File 'lib/jaxx/api_mapper.rb', line 24 def host h = nil @host = h if h @host end |