Class: Fuselage::Base
- Inherits:
-
Object
- Object
- Fuselage::Base
- Defined in:
- lib/fuselage/base.rb
Instance Attribute Summary collapse
-
#api ⇒ Object
Returns the value of attribute api.
Class Method Summary collapse
- .delete_method(path, params = {}) ⇒ Object
- .get(path, params = {}) ⇒ Object
- .post(path, params = {}) ⇒ Object
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(attributes = {}) ⇒ Base
Returns a new instance of Base.
6 7 8 9 10 11 12 13 14 |
# File 'lib/fuselage/base.rb', line 6 def initialize(attributes={}) # Useful for finding out what attr_accessor needs for classes # puts caller.first.inspect # puts "#{self.class.inspect} #{attributes.keys.map { |s| s.to_sym }.inspect}" attributes.each do |key, value| method = "#{key}=" self.send(method, value) if respond_to? method end end |
Instance Attribute Details
#api ⇒ Object
Returns the value of attribute api.
4 5 6 |
# File 'lib/fuselage/base.rb', line 4 def api @api end |
Class Method Details
.delete_method(path, params = {}) ⇒ Object
26 27 28 |
# File 'lib/fuselage/base.rb', line 26 def self.delete_method(path, params={}) Api.api.delete(path, params, self) end |