Class: Diffend::Config
- Inherits:
-
Object
- Object
- Diffend::Config
- Defined in:
- lib/diffend/config.rb
Overview
Diffend config object
Instance Attribute Summary collapse
-
#build_path ⇒ Object
readonly
Returns the value of attribute build_path.
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#project_id ⇒ Object
readonly
Returns the value of attribute project_id.
-
#shareable_id ⇒ Object
readonly
Returns the value of attribute shareable_id.
-
#shareable_key ⇒ Object
readonly
Returns the value of attribute shareable_key.
Instance Method Summary collapse
-
#commands_url ⇒ String
Provides diffend commands endpoint url.
- #development? ⇒ Boolean
-
#errors_url ⇒ String
Provides diffend errors endpoint url.
- #ignore_errors? ⇒ Boolean
-
#initialize(command: nil, severity: nil, build_path: nil) ⇒ Diffend::Config
constructor
Build diffend config object.
- #logger ⇒ Object
- #track_url(request_id) ⇒ String
Constructor Details
#initialize(command: nil, severity: nil, build_path: nil) ⇒ Diffend::Config
Build diffend config object
11 12 13 14 15 |
# File 'lib/diffend/config.rb', line 11 def initialize(command: nil, severity: nil, build_path: nil) @log_level = severity build(command, build_path) validate end |
Instance Attribute Details
#build_path ⇒ Object (readonly)
Returns the value of attribute build_path.
6 7 8 |
# File 'lib/diffend/config.rb', line 6 def build_path @build_path end |
#command ⇒ Object (readonly)
Returns the value of attribute command.
6 7 8 |
# File 'lib/diffend/config.rb', line 6 def command @command end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
6 7 8 |
# File 'lib/diffend/config.rb', line 6 def env @env end |
#project_id ⇒ Object (readonly)
Returns the value of attribute project_id.
6 7 8 |
# File 'lib/diffend/config.rb', line 6 def project_id @project_id end |
#shareable_id ⇒ Object (readonly)
Returns the value of attribute shareable_id.
6 7 8 |
# File 'lib/diffend/config.rb', line 6 def shareable_id @shareable_id end |
#shareable_key ⇒ Object (readonly)
Returns the value of attribute shareable_key.
6 7 8 |
# File 'lib/diffend/config.rb', line 6 def shareable_key @shareable_key end |
Instance Method Details
#commands_url ⇒ String
Provides diffend commands endpoint url
32 33 34 35 36 |
# File 'lib/diffend/config.rb', line 32 def commands_url return ENV['DIFFEND_COMMANDS_URL'] if ENV.key?('DIFFEND_COMMANDS_URL') "https://my.diffend.io/api/projects/#{project_id}/bundle/#{command}" end |
#development? ⇒ Boolean
25 26 27 |
# File 'lib/diffend/config.rb', line 25 def development? @development end |
#errors_url ⇒ String
Provides diffend errors endpoint url
41 42 43 44 45 |
# File 'lib/diffend/config.rb', line 41 def errors_url return ENV['DIFFEND_ERRORS_URL'] if ENV.key?('DIFFEND_ERRORS_URL') "https://my.diffend.io/api/projects/#{project_id}/errors" end |
#ignore_errors? ⇒ Boolean
21 22 23 |
# File 'lib/diffend/config.rb', line 21 def ignore_errors? @ignore_errors end |
#logger ⇒ Object
17 18 19 |
# File 'lib/diffend/config.rb', line 17 def logger @logger ||= Diffend::Logger.new(@log_level) end |
#track_url(request_id) ⇒ String
50 51 52 |
# File 'lib/diffend/config.rb', line 50 def track_url(request_id) "https://my.diffend.io/api/projects/#{project_id}/bundle/#{request_id}/track" end |