Class: MyJohnDeere::Configuration
- Inherits:
-
Object
- Object
- MyJohnDeere::Configuration
- Defined in:
- lib/myjohndeere.rb
Instance Attribute Summary collapse
- #app_id ⇒ Object
- #contribution_definition_id ⇒ Object
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#environment ⇒ Object
Returns the value of attribute environment.
- #shared_secret ⇒ Object
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #log_level ⇒ Object
- #log_level=(val) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
101 102 103 104 105 106 |
# File 'lib/myjohndeere.rb', line 101 def initialize # Assume the sandbox endpoint self.environment = :sandbox @shared_secret = nil @app_id = nil end |
Instance Attribute Details
#app_id ⇒ Object
124 125 126 127 128 129 130 |
# File 'lib/myjohndeere.rb', line 124 def app_id if @app_id.nil? then raise ConfigurationError.new('No app_id provided in configuration. ' \ 'Please set this according to your Deere Developer app credentials.') end return @app_id end |
#contribution_definition_id ⇒ Object
108 109 110 111 112 113 114 |
# File 'lib/myjohndeere.rb', line 108 def contribution_definition_id if @contribution_definition_id.nil? then raise ConfigurationError.new('No contribution_definition_id provided in configuration. ' \ 'Please set this to make the request, you\'ll need to contact JohnDeere support to get this value.') end return @contribution_definition_id end |
#endpoint ⇒ Object
Returns the value of attribute endpoint.
80 81 82 |
# File 'lib/myjohndeere.rb', line 80 def endpoint @endpoint end |
#environment ⇒ Object
Returns the value of attribute environment.
82 83 84 |
# File 'lib/myjohndeere.rb', line 82 def environment @environment end |
#shared_secret ⇒ Object
116 117 118 119 120 121 122 |
# File 'lib/myjohndeere.rb', line 116 def shared_secret if @shared_secret.nil? then raise ConfigurationError.new('No shared_secret provided in configuration. ' \ 'Please set this according to your Deere Developer app credentials.') end return @shared_secret end |
Instance Method Details
#log_level ⇒ Object
88 89 90 91 |
# File 'lib/myjohndeere.rb', line 88 def log_level @log_level ||= :fatal return @log_level end |
#log_level=(val) ⇒ Object
84 85 86 |
# File 'lib/myjohndeere.rb', line 84 def log_level=(val) @log_level = val end |