Class: TinyerpRuby::Connection
- Inherits:
-
Object
- Object
- TinyerpRuby::Connection
- Defined in:
- lib/tinyerp_ruby/connection.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
Instance Method Summary collapse
-
#initialize(api_key, environment = :production) ⇒ Connection
constructor
A new instance of Connection.
Constructor Details
#initialize(api_key, environment = :production) ⇒ Connection
Returns a new instance of Connection.
5 6 7 8 9 |
# File 'lib/tinyerp_ruby/connection.rb', line 5 def initialize(api_key, environment = :production) @environment = eval(environment.to_s.capitalize) @base_url = @environment::BASE_URL @api_key = api_key end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
3 4 5 |
# File 'lib/tinyerp_ruby/connection.rb', line 3 def api_key @api_key end |
#base_url ⇒ Object (readonly)
Returns the value of attribute base_url.
3 4 5 |
# File 'lib/tinyerp_ruby/connection.rb', line 3 def base_url @base_url end |
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
3 4 5 |
# File 'lib/tinyerp_ruby/connection.rb', line 3 def environment @environment end |