Class: Piglet::Field::CallExpression

Inherits:
Object
  • Object
show all
Includes:
Field
Defined in:
lib/piglet/field/call_expression.rb

Overview

:nodoc:

Constant Summary

Constants included from Field

Field::FUNCTIONS, Field::SYMBOLIC_OPERATORS

Instance Attribute Summary

Attributes included from Field

#name, #type

Instance Method Summary collapse

Methods included from Field

#and, #as, #cast, #diff, #empty?, #matches, #ne, #neg, #not, #not_null?, #null?, #or

Constructor Details

#initialize(function_name, inner_expression, options = nil) ⇒ CallExpression

Returns a new instance of CallExpression.



8
9
10
11
12
# File 'lib/piglet/field/call_expression.rb', line 8

def initialize(function_name, inner_expression, options=nil)
  options ||= {}
  @function_name, @inner_expression = function_name, inner_expression
  @type = options[:type] || inner_expression.type
end

Instance Method Details

#simple?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/piglet/field/call_expression.rb', line 14

def simple?
  false
end

#to_sObject



18
19
20
# File 'lib/piglet/field/call_expression.rb', line 18

def to_s
  "#{@function_name}(#{@inner_expression})"
end