Class: WarningSigns::Environment

Inherits:
Object
  • Object
show all
Defined in:
lib/warning_signs/environment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#behaviorsObject

Returns the value of attribute behaviors.



3
4
5
# File 'lib/warning_signs/environment.rb', line 3

def behaviors
  @behaviors
end

#environmentObject

Returns the value of attribute environment.



3
4
5
# File 'lib/warning_signs/environment.rb', line 3

def environment
  @environment
end