Class: Solid::Parser::MethodCall

Inherits:
Struct
  • Object
show all
Includes:
MethodWhitelist
Defined in:
lib/solid/parser.rb

Constant Summary collapse

BUILTIN_HANDLERS =
{
  :'&&' => ->(left, right) { left && right },
  :'||' => ->(left, right) { left || right }
}

Constants included from MethodWhitelist

MethodWhitelist::METHODS_BLACKLIST, MethodWhitelist::METHODS_WHITELIST

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from MethodWhitelist

allow, deny, safely_respond_to?

Instance Attribute Details

#argumentsObject

Returns the value of attribute arguments

Returns:

  • (Object)

    the current value of arguments



36
37
38
# File 'lib/solid/parser.rb', line 36

def arguments
  @arguments
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



36
37
38
# File 'lib/solid/parser.rb', line 36

def name
  @name
end

#receiverObject

Returns the value of attribute receiver

Returns:

  • (Object)

    the current value of receiver



36
37
38
# File 'lib/solid/parser.rb', line 36

def receiver
  @receiver
end

Instance Method Details

#evaluate(context) ⇒ Object



43
44
45
# File 'lib/solid/parser.rb', line 43

def evaluate(context)
  Solid.to_liquid(pluck(receiver.evaluate(context), name, *arguments.map {|arg| arg.evaluate(context) }), context)
end