Class: WashoutBuilder::EnvChecker
- Inherits:
-
Object
- Object
- WashoutBuilder::EnvChecker
- Defined in:
- lib/washout_builder/env_checker.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
Returns the value of attribute app.
Instance Method Summary collapse
- #available_for_env?(env_name) ⇒ Boolean
-
#initialize(app) ⇒ EnvChecker
constructor
A new instance of EnvChecker.
Constructor Details
#initialize(app) ⇒ EnvChecker
Returns a new instance of EnvChecker.
7 8 9 |
# File 'lib/washout_builder/env_checker.rb', line 7 def initialize(app) self.app = app end |
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app.
4 5 6 |
# File 'lib/washout_builder/env_checker.rb', line 4 def app @app end |
Instance Method Details
#available_for_env?(env_name) ⇒ Boolean
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/washout_builder/env_checker.rb', line 11 def available_for_env?(env_name) if whitelist.present? || blacklist.present? if whitelist.find{|a| blacklist.include?(a) }.blank? if whitelist.include?('*') || (!valid_for_env?(blacklist, env_name) && valid_for_env?(whitelist, env_name)) return true end end else return true end false end |