Class: Postscript::Model::Operators::Container::Anchorsearch

Inherits:
Postscript::Model::Operator show all
Defined in:
lib/postscript/model/operators/container.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Postscript::Model::Operator

#accept, #operator?, register_as

Constructor Details

#initialize(target:, pattern:) ⇒ Anchorsearch

Returns a new instance of Anchorsearch.



133
134
135
136
137
# File 'lib/postscript/model/operators/container.rb', line 133

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

Instance Attribute Details

#patternObject (readonly)

Returns the value of attribute pattern.



132
133
134
# File 'lib/postscript/model/operators/container.rb', line 132

def pattern
  @pattern
end

#targetObject (readonly)

Returns the value of attribute target.



132
133
134
# File 'lib/postscript/model/operators/container.rb', line 132

def target
  @target
end

Class Method Details

.from_operands(stack) ⇒ Object



138
139
140
141
142
# File 'lib/postscript/model/operators/container.rb', line 138

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