Module: Einvoice::Configuration
- Included in:
- Einvoice
- Defined in:
- lib/einvoice/configuration.rb
Constant Summary collapse
- VALID_OPTIONS_KEYS =
[ :endpoint, :client_id, :client_secret, :format, ].freeze
- DEFAULT_CLIENT_ID =
nil- DEFAULT_CLIENT_SECRET =
nil- DEFAULT_ENDPOINT =
"".freeze
- DEFAULT_FORMAT =
""
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.extended(base) ⇒ Object
19 20 21 |
# File 'lib/einvoice/configuration.rb', line 19 def self.extended(base) base.reset end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
23 24 25 |
# File 'lib/einvoice/configuration.rb', line 23 def configure yield self end |
#options ⇒ Object
27 28 29 30 31 |
# File 'lib/einvoice/configuration.rb', line 27 def VALID_OPTIONS_KEYS.inject({}) do |option, key| option.merge!(key => send(key)) end end |
#reset ⇒ Object
33 34 35 36 37 38 |
# File 'lib/einvoice/configuration.rb', line 33 def reset self.endpoint = DEFAULT_ENDPOINT self.client_id = DEFAULT_CLIENT_ID self.client_secret = DEFAULT_CLIENT_SECRET self.format = DEFAULT_FORMAT end |