Class: Licensario::Base
- Inherits:
-
Object
- Object
- Licensario::Base
- Defined in:
- lib/licensario/base.rb
Direct Known Subclasses
Constant Summary collapse
- @@api =
nil
- @@date_format =
"%Y%m%d%H%M%S"
Class Method Summary collapse
- .api ⇒ Object
- .date_format ⇒ Object
-
.establish_connection(options = {}) ⇒ Object
Establish a common connection for all Licensario operations.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(attributes = {}) ⇒ Base
Returns a new instance of Base.
12 13 14 15 16 17 |
# File 'lib/licensario/base.rb', line 12 def initialize(attributes = {}) @attributes = attributes @attributes.each do |k,v| self.send(k.to_s + '=',v) end end |
Class Method Details
.api ⇒ Object
29 30 31 |
# File 'lib/licensario/base.rb', line 29 def self.api @@api end |
.date_format ⇒ Object
33 34 35 |
# File 'lib/licensario/base.rb', line 33 def self.date_format @@date_format end |
.establish_connection(options = {}) ⇒ Object
Establish a common connection for all Licensario operations
20 21 22 23 24 25 26 27 |
# File 'lib/licensario/base.rb', line 20 def self.establish_connection( = {}) @options = { base_url: 'users.licensario.com', use_ssl: true, debug: false }.merge() @@api = Licensario::API.new(@options[:key], @options[:secret], @options[:base_url], @options[:use_ssl], @options[:debug]) end |