Class: RailsContractSync::Configuration
- Inherits:
-
Object
- Object
- RailsContractSync::Configuration
- Defined in:
- lib/rails_contract_sync/configuration.rb
Instance Attribute Summary collapse
-
#observations_path ⇒ Object
Returns the value of attribute observations_path.
-
#output_path ⇒ Object
Returns the value of attribute output_path.
Instance Method Summary collapse
- #enabled? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #observation_store ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 8 |
# File 'lib/rails_contract_sync/configuration.rb', line 5 def initialize @output_path = "openapi.yml" @observations_path = "tmp/rails_contract_sync/observations.jsonl" end |
Instance Attribute Details
#observations_path ⇒ Object
Returns the value of attribute observations_path.
3 4 5 |
# File 'lib/rails_contract_sync/configuration.rb', line 3 def observations_path @observations_path end |
#output_path ⇒ Object
Returns the value of attribute output_path.
3 4 5 |
# File 'lib/rails_contract_sync/configuration.rb', line 3 def output_path @output_path end |
Instance Method Details
#enabled? ⇒ Boolean
10 11 12 13 |
# File 'lib/rails_contract_sync/configuration.rb', line 10 def enabled? v = ENV["RAILS_CONTRACT_SYNC"] !v.nil? && !v.empty? && v != "0" && v.downcase != "false" end |
#observation_store ⇒ Object
15 16 17 |
# File 'lib/rails_contract_sync/configuration.rb', line 15 def observation_store Runtime::ObservationStore.new(observations_path) end |