Class: Postscript::Model::Operators::Container::Search
- Inherits:
-
Postscript::Model::Operator
- Object
- Postscript::Model::Operator
- Postscript::Model::Operators::Container::Search
- Defined in:
- lib/postscript/model/operators/container.rb
Instance Attribute Summary collapse
-
#pattern ⇒ Object
readonly
Returns the value of attribute pattern.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(target:, pattern:) ⇒ Search
constructor
A new instance of Search.
Methods inherited from Postscript::Model::Operator
#accept, #operator?, register_as
Constructor Details
#initialize(target:, pattern:) ⇒ Search
Returns a new instance of Search.
118 119 120 121 122 |
# File 'lib/postscript/model/operators/container.rb', line 118 def initialize(target:, pattern:) @target = target @pattern = pattern freeze end |
Instance Attribute Details
#pattern ⇒ Object (readonly)
Returns the value of attribute pattern.
117 118 119 |
# File 'lib/postscript/model/operators/container.rb', line 117 def pattern @pattern end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
117 118 119 |
# File 'lib/postscript/model/operators/container.rb', line 117 def target @target end |
Class Method Details
.from_operands(stack) ⇒ Object
123 124 125 126 127 |
# File 'lib/postscript/model/operators/container.rb', line 123 def self.from_operands(stack) pattern = stack.pop target = stack.pop new(target: target, pattern: pattern) end |