Class: Fuselage::Base
- Inherits:
-
Object
show all
- Defined in:
- lib/fuselage/base.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
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={})
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
|
.get(path, params = {}) ⇒ Object
16
17
18
19
|
# File 'lib/fuselage/base.rb', line 16
def self.get(path, params={})
response = Api.api.get(path, params, self)
response.parsed_response
end
|
.post(path, params = {}) ⇒ Object
21
22
23
24
|
# File 'lib/fuselage/base.rb', line 21
def self.post(path, params={})
response = Api.api.post(path, params, self)
response.parsed_response
end
|