Class: SKApi::Resources::Base
- Inherits:
-
ActiveResource::Base
- Object
- ActiveResource::Base
- SKApi::Resources::Base
- Includes:
- Utils::Serializer
- Defined in:
- lib/resources/base.rb
Class Method Summary collapse
-
.set_connection(opts) ⇒ Object
Define the connection to be used when talking to a salesking server.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Base
constructor
A new instance of Base.
Methods included from Utils::Serializer
Methods inherited from ActiveResource::Base
#encode, instantiate_collection, #load_attributes_from_response
Constructor Details
#initialize(attributes = {}) ⇒ Base
Returns a new instance of Base.
10 11 12 13 |
# File 'lib/resources/base.rb', line 10 def initialize(attributes = {}, *args) attr = attributes[self.class.element_name] || attributes super(attr, *args) end |
Class Method Details
.set_connection(opts) ⇒ Object
Define the connection to be used when talking to a salesking server
22 23 24 25 26 27 |
# File 'lib/resources/base.rb', line 22 def self.set_connection(opts) self.site = opts[:site] self.user = opts[:user] self.password = opts[:password] self.format = opts[:format].to_sym end |