Class: DearInventory::Config
- Inherits:
-
Object
- Object
- DearInventory::Config
- Extended by:
- T::Sig
- Defined in:
- lib/dear_inventory/config.rb
Instance Attribute Summary collapse
-
#account_id ⇒ Object
Returns the value of attribute account_id.
-
#key ⇒ Object
Returns the value of attribute key.
Instance Method Summary collapse
- #environment ⇒ Object
- #environment=(value) ⇒ Object
- #require(param) ⇒ Object
- #require_parameter(param) ⇒ Object
Instance Attribute Details
#account_id ⇒ Object
Returns the value of attribute account_id.
19 20 21 |
# File 'lib/dear_inventory/config.rb', line 19 def account_id @account_id end |
#key ⇒ Object
Returns the value of attribute key.
22 23 24 |
# File 'lib/dear_inventory/config.rb', line 22 def key @key end |
Instance Method Details
#environment ⇒ Object
9 10 11 |
# File 'lib/dear_inventory/config.rb', line 9 def environment DearInventory::Environment end |
#environment=(value) ⇒ Object
14 15 16 |
# File 'lib/dear_inventory/config.rb', line 14 def environment=(value) DearInventory::Environment.set(value) end |
#require(param) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/dear_inventory/config.rb', line 25 def require(param) value = public_send(param) return value unless value.nil? || value.empty? require_error(param) end |
#require_parameter(param) ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/dear_inventory/config.rb', line 33 def require_parameter(param) require(param) rescue ArgumentError => e = e. + "\n" \ "Alternatively, you can pass dynamic values with your request " \ "parameters" raise ArgumentError, end |