Class: Amiando::ApiKey
Overview
Instance Attribute Summary
Attributes inherited from Resource
#attributes, #request, #response, #success
Class Method Summary (collapse)
-
+ (Object) create(attributes)
Creates an ApiKey.
-
+ (Object) update(id, attributes)
Updates an ApiKey.
Instance Method Summary (collapse)
Methods inherited from Resource
#==, #[], #extract_attributes_from, #id, #initialize, map, map_params, mapping, #method_missing, method_missing, #populate_create, reverse_map_params, typecasting
Methods included from Autorun
Constructor Details
This class inherits a constructor from Amiando::Resource
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Amiando::Resource
Class Method Details
+ (Object) create(attributes)
Creates an Amiando::ApiKey.
11 12 13 14 15 16 17 18 |
# File 'lib/amiando/api_key.rb', line 11 def self.create(attributes) raise ArgumentError.new('ApiKey name field is mandatory') unless attributes[:name] object = new post object, '/api/apiKey/create', :params => attributes object end |
+ (Object) update(id, attributes)
Updates an Amiando::ApiKey.
24 25 26 27 28 29 |
# File 'lib/amiando/api_key.rb', line 24 def self.update(id, attributes) object = Boolean.new(:success) post object, "/api/apiKey/#{id}", :params => attributes object end |
Instance Method Details
- (Object) populate(response_body)
31 32 33 |
# File 'lib/amiando/api_key.rb', line 31 def populate(response_body) extract_attributes_from(response_body, 'apiKey') end |