Class: Contur::Config::Before
- Inherits:
-
Array
- Object
- Array
- Contur::Config::Before
- Defined in:
- lib/contur/config/before.rb
Overview
Before section
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
-
#initialize(before_commands = []) ⇒ Before
constructor
A new instance of Before.
- #name ⇒ Object
- #to_bash_script ⇒ Object
- #validate!(_before_commands) ⇒ Object
Constructor Details
#initialize(before_commands = []) ⇒ Before
Returns a new instance of Before.
6 7 8 9 10 |
# File 'lib/contur/config/before.rb', line 6 def initialize(before_commands = []) super([]) validate!(before_commands) replace(before_commands) unless before_commands.nil? end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
16 17 18 |
# File 'lib/contur/config/before.rb', line 16 def errors @errors end |
Instance Method Details
#name ⇒ Object
18 19 20 |
# File 'lib/contur/config/before.rb', line 18 def name "Section 'before'" end |
#to_bash_script ⇒ Object
22 23 24 |
# File 'lib/contur/config/before.rb', line 22 def to_bash_script reduce('') { |a, e| a + "#{e}\n" } end |
#validate!(_before_commands) ⇒ Object
12 13 14 |
# File 'lib/contur/config/before.rb', line 12 def validate!(_before_commands) @errors = [] end |