Class: BigDoor::Currency
- Inherits:
-
Object
- Object
- BigDoor::Currency
- Includes:
- ClassMethods
- Defined in:
- lib/big-door/currency.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(params) ⇒ Currency
constructor
A new instance of Currency.
Methods included from ClassMethods
app_key, included, #parse_out_classes, #perform_request, #remote_id, secret_key
Constructor Details
#initialize(params) ⇒ Currency
Returns a new instance of Currency.
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/big-door/currency.rb', line 5 def initialize(params) params.each_pair do |key, val| self.class.class_eval do # overwrite the .id method and all others self.instance_eval do attr_accessor key end end instance_variable_set("@#{key}", val) end end |
Class Method Details
.all ⇒ Object
17 18 19 |
# File 'lib/big-door/currency.rb', line 17 def self.all perform_request('get', 'currency') end |
.find(params = {}) ⇒ Object
21 22 23 |
# File 'lib/big-door/currency.rb', line 21 def self.find(params={}) perform_request('get', 'currency', params) end |