Class: Amiando::ApiKey
Overview
Instance Attribute Summary
Attributes inherited from Resource
Class Method Summary collapse
-
.create(attributes) ⇒ ApiKey
Creates an ApiKey.
-
.update(id, attributes) ⇒ Boolean
Updates an ApiKey.
Methods inherited from Resource
#==, #extract_attributes_from, #initialize, method_missing, #populate_create
Methods included from Attributes
#[], #id, included, #method_missing, #respond_to?, #type
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::Attributes
Class Method Details
.create(attributes) ⇒ ApiKey
Creates an Amiando::ApiKey.
14 15 16 17 18 19 20 21 |
# File 'lib/amiando/api_key.rb', line 14 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 |
.update(id, attributes) ⇒ Boolean
Updates an Amiando::ApiKey.
28 29 30 31 32 33 |
# File 'lib/amiando/api_key.rb', line 28 def self.update(id, attributes) object = Boolean.new(:success) post object, "/api/apiKey/#{id}", :params => attributes object end |