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.
103 104 105 106 107 108 |
# File 'lib/myjohndeere.rb', line 103 def initialize # Assume the sandbox endpoint self.environment = :sandbox @shared_secret = nil @app_id = nil end |
Instance Attribute Details
#app_id ⇒ Object
126 127 128 129 130 131 132 |
# File 'lib/myjohndeere.rb', line 126 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
110 111 112 113 114 115 116 |
# File 'lib/myjohndeere.rb', line 110 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.
82 83 84 |
# File 'lib/myjohndeere.rb', line 82 def endpoint @endpoint end |
#environment ⇒ Object
Returns the value of attribute environment.
84 85 86 |
# File 'lib/myjohndeere.rb', line 84 def environment @environment end |
#shared_secret ⇒ Object
118 119 120 121 122 123 124 |
# File 'lib/myjohndeere.rb', line 118 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
90 91 92 93 |
# File 'lib/myjohndeere.rb', line 90 def log_level @log_level ||= :fatal return @log_level end |
#log_level=(val) ⇒ Object
86 87 88 |
# File 'lib/myjohndeere.rb', line 86 def log_level=(val) @log_level = val end |