Class: Oso::Polar::Predicate

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

Overview

Polar predicate.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, args:) ⇒ Predicate

Returns a new instance of Predicate.

Parameters:

  • name (String)
  • args (Array<Object>)


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

def initialize(name, args:)
  @name = name
  @args = args
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



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

def args
  @args
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

Instance Method Details

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

Parameters:

Returns:

  • (Boolean)


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

def ==(other)
  name == other.name && args == other.args
end