Class: WarningSigns::Environment
- Inherits:
-
Object
- Object
- WarningSigns::Environment
- Defined in:
- lib/warning_signs/environment.rb
Instance Attribute Summary collapse
-
#behaviors ⇒ Object
Returns the value of attribute behaviors.
-
#environment ⇒ Object
Returns the value of attribute environment.
Instance Method Summary collapse
-
#initialize(environment:, behaviors: [], behavior: nil) ⇒ Environment
constructor
A new instance of Environment.
Constructor Details
#initialize(environment:, behaviors: [], behavior: nil) ⇒ Environment
Returns a new instance of Environment.
5 6 7 8 9 10 |
# File 'lib/warning_signs/environment.rb', line 5 def initialize(environment:, behaviors: [], behavior: nil) @environment = environment.to_s.downcase.inquiry @behaviors = (behaviors + [behavior]) .compact .map { _1.to_s.downcase.inquiry } end |
Instance Attribute Details
#behaviors ⇒ Object
Returns the value of attribute behaviors.
3 4 5 |
# File 'lib/warning_signs/environment.rb', line 3 def behaviors @behaviors end |
#environment ⇒ Object
Returns the value of attribute environment.
3 4 5 |
# File 'lib/warning_signs/environment.rb', line 3 def environment @environment end |