Method: JSI::Base::HashNode#jsi_node_content_hash_pubsend

Defined in:
lib/jsi/base/node.rb,
lib/jsi/base/node.rb

#jsi_node_content_hash_pubsend(method_name, *a, **kw, &b) ⇒ Object

invokes the method with the given name on the jsi_node_content (if defined) or its #to_hash

Parameters:

  • method_name (String, Symbol)
  • a

    positional arguments are passed to the invocation of method_name

  • kw

    keyword arguments are passed to the invocation of method_name

  • b

    block is passed to the invocation of method_name

Returns:

  • (Object)

    the result of calling method method_name on the jsi_node_content or its #to_hash



140
141
142
143
144
145
146
# File 'lib/jsi/base/node.rb', line 140

def jsi_node_content_hash_pubsend(method_name, *a, &b)
  if jsi_node_content.respond_to?(method_name)
    jsi_node_content.public_send(method_name, *a, &b)
  else
    jsi_node_content.to_hash.public_send(method_name, *a, &b)
  end
end