Class: Luoma::PredicateFunction

Inherits:
Object
  • Object
show all
Defined in:
lib/luoma/expression.rb,
sig/luoma/expression.rbs

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, func) ⇒ PredicateFunction

(String, untyped) -> void

Parameters:

  • name (String)
  • func (Object)


1148
1149
1150
1151
# File 'lib/luoma/expression.rb', line 1148

def initialize(name, func)
  @name = name
  @func = func
end

Instance Attribute Details

#funcObject (readonly)

Returns the value of attribute func.

Returns:

  • (Object)


1145
1146
1147
# File 'lib/luoma/expression.rb', line 1145

def func
  @func
end

#nameString (readonly)

Returns the value of attribute name.

Returns:

  • (String)


1145
1146
1147
# File 'lib/luoma/expression.rb', line 1145

def name
  @name
end

Instance Method Details

#call(context, obj) ⇒ Boolean

(RenderContext, untyped) -> bool

Parameters:

Returns:

  • (Boolean)


1154
1155
1156
# File 'lib/luoma/expression.rb', line 1154

def call(context, obj)
  @func.call(context, obj)
end