Class: Postsvg::Model::Operators::Container::Search

Inherits:
Postsvg::Model::Operator show all
Defined in:
lib/postsvg/model/operators/container.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Postsvg::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/postsvg/model/operators/container.rb', line 118

def initialize(target:, pattern:)
  @target = target
  @pattern = pattern
  freeze
end

Instance Attribute Details

#patternObject (readonly)

Returns the value of attribute pattern.



117
118
119
# File 'lib/postsvg/model/operators/container.rb', line 117

def pattern
  @pattern
end

#targetObject (readonly)

Returns the value of attribute target.



117
118
119
# File 'lib/postsvg/model/operators/container.rb', line 117

def target
  @target
end

Class Method Details

.from_operands(stack) ⇒ Object



123
124
125
126
127
# File 'lib/postsvg/model/operators/container.rb', line 123

def self.from_operands(stack)
  pattern = stack.pop
  target = stack.pop
  new(target: target, pattern: pattern)
end