Class: Oso::Polar::Pattern

Inherits:
Object
  • Object
show all
Defined in:
lib/oso/polar/pattern.rb

Overview

Polar pattern.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tag, fields) ⇒ Pattern

Returns a new instance of Pattern.

Parameters:

  • tag (String)
  • fields (Hash<String, Object>)


11
12
13
14
# File 'lib/oso/polar/pattern.rb', line 11

def initialize(tag, fields)
  @tag = tag
  @fields = fields
end

Instance Attribute Details

#fieldsObject (readonly)

Returns the value of attribute fields.



7
8
9
# File 'lib/oso/polar/pattern.rb', line 7

def fields
  @fields
end

#tagObject (readonly)

Returns the value of attribute tag.



7
8
9
# File 'lib/oso/polar/pattern.rb', line 7

def tag
  @tag
end

Instance Method Details

#==(other) ⇒ Boolean Also known as: eql?

Parameters:

Returns:

  • (Boolean)


18
19
20
# File 'lib/oso/polar/pattern.rb', line 18

def ==(other)
  tag == other.tag && fields == other.fields
end