Class: ProconBypassMan::Procon::MacroBuilder
- Inherits:
-
Object
- Object
- ProconBypassMan::Procon::MacroBuilder
- Defined in:
- lib/procon_bypass_man/procon/macro_builder.rb
Defined Under Namespace
Classes: Subject, SubjectMerger
Constant Summary collapse
- RESERVED_WORD_NONE =
:none
- RESERVED_WORDS =
{ RESERVED_WORD_NONE => true, }
Instance Method Summary collapse
- #build ⇒ Arary<Symbol>
-
#initialize(steps) ⇒ MacroBuilder
constructor
A new instance of MacroBuilder.
Constructor Details
#initialize(steps) ⇒ MacroBuilder
Returns a new instance of MacroBuilder.
55 56 57 |
# File 'lib/procon_bypass_man/procon/macro_builder.rb', line 55 def initialize(steps) @steps = steps.map(&:to_s) end |
Instance Method Details
#build ⇒ Arary<Symbol>
60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/procon_bypass_man/procon/macro_builder.rb', line 60 def build steps = @steps.flat_map { |step| if is_reserved?(step: step) || v1_format?(step: step) step.to_sym elsif value = build_if_v2_format?(step: step) value else nil end } steps.compact end |