Class: Mustermann::Set::Match

Inherits:
Match
  • Object
show all
Defined in:
lib/mustermann/set/match.rb

Instance Attribute Summary collapse

Attributes inherited from Match

#params, #pattern, #post_match, #pre_match, #string

Instance Method Summary collapse

Methods inherited from Match

#[], #deconstruct_keys, #eql?, #hash, #values_at

Constructor Details

#initialize(pattern = nil, string = nil, params = {}, value: nil, match: nil, post_match: '', pre_match: '') ⇒ Match

Returns a new instance of Match.



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/mustermann/set/match.rb', line 9

def initialize(pattern = nil, string = nil, params = {}, value: nil, match: nil, post_match: '', pre_match: '')
  @value = value
  if match
    @pattern    = match.pattern
    @string     = match.string
    @params     = match.params
    @post_match = match.post_match
    @pre_match  = match.pre_match
  else
    super(pattern, string, params, post_match:, pre_match:)
  end
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



7
8
9
# File 'lib/mustermann/set/match.rb', line 7

def value
  @value
end