Class: Unleash::Bootstrap::Configuration
- Inherits:
-
Object
- Object
- Unleash::Bootstrap::Configuration
- Defined in:
- lib/unleash/bootstrap/configuration.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#data ⇒ Object
Returns the value of attribute data.
-
#file_path ⇒ Object
Returns the value of attribute file_path.
-
#url ⇒ Object
Returns the value of attribute url.
-
#url_headers ⇒ Object
Returns the value of attribute url_headers.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Configuration
constructor
A new instance of Configuration.
- #valid? ⇒ Boolean
Constructor Details
#initialize(opts = {}) ⇒ Configuration
Returns a new instance of Configuration.
6 7 8 9 10 11 12 |
# File 'lib/unleash/bootstrap/configuration.rb', line 6 def initialize(opts = {}) self.file_path = resolve_value_indifferently(opts, 'file_path') || ENV['UNLEASH_BOOTSTRAP_FILE'] || nil self.url = resolve_value_indifferently(opts, 'url') || ENV['UNLEASH_BOOTSTRAP_URL'] || nil self.url_headers = resolve_value_indifferently(opts, 'url_headers') self.data = resolve_value_indifferently(opts, 'data') self.block = resolve_value_indifferently(opts, 'block') end |
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block.
4 5 6 |
# File 'lib/unleash/bootstrap/configuration.rb', line 4 def block @block end |
#data ⇒ Object
Returns the value of attribute data.
4 5 6 |
# File 'lib/unleash/bootstrap/configuration.rb', line 4 def data @data end |
#file_path ⇒ Object
Returns the value of attribute file_path.
4 5 6 |
# File 'lib/unleash/bootstrap/configuration.rb', line 4 def file_path @file_path end |
#url ⇒ Object
Returns the value of attribute url.
4 5 6 |
# File 'lib/unleash/bootstrap/configuration.rb', line 4 def url @url end |
#url_headers ⇒ Object
Returns the value of attribute url_headers.
4 5 6 |
# File 'lib/unleash/bootstrap/configuration.rb', line 4 def url_headers @url_headers end |
Instance Method Details
#valid? ⇒ Boolean
14 15 16 |
# File 'lib/unleash/bootstrap/configuration.rb', line 14 def valid? ![self.data, self.file_path, self.url, self.block].all?(&:nil?) end |