Class: Wes::Data::API::Billing
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Base
client, configuration, #exist?, #initialize, mapped_objects, #method_missing, routes
Constructor Details
This class inherits a constructor from Wes::Data::API::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Wes::Data::API::Base
Class Method Details
.create(data) ⇒ Object
8 9 10 11 |
# File 'lib/wes/data/api/billing.rb', line 8 def create(data) attributes = client.post("#{routes.billing}", data).first new(attributes) end |
.find(key, value) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/wes/data/api/billing.rb', line 13 def find(key, value) case key when :id super("#{routes.billing}/#{value}") when :user_id super("#{routes.user}/#{value}/billing") end end |
Instance Method Details
#update(changes) ⇒ Object
23 24 25 |
# File 'lib/wes/data/api/billing.rb', line 23 def update(changes) super("#{routes.billing}/#{id}", changes) end |