Class: Expressir::Model::Expressions::UnaryExpression

Inherits:
Expressir::Model::Expression show all
Defined in:
lib/expressir/model/expressions/unary_expression.rb

Overview

Specified in ISO 10303-11:2004

  • section 12.1 Arithmetic operators

  • section 12.4.1 NOT operator

Constant Summary collapse

MINUS =
:MINUS
NOT =
:NOT
PLUS =
:PLUS

Instance Attribute Summary collapse

Attributes inherited from ModelElement

#parent

Instance Method Summary collapse

Methods inherited from ModelElement

#children, #children_by_id, #find, from_hash, model_attr_accessor, model_attrs, #path, #reset_children_by_id, #to_hash, #to_liquid, #to_s

Constructor Details

#initialize(options = {}) ⇒ UnaryExpression

Returns a new instance of UnaryExpression.

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :operator (:MINUS, :NOT, :PLUS)
  • :operand (Expression)


18
19
20
21
22
23
# File 'lib/expressir/model/expressions/unary_expression.rb', line 18

def initialize(options = {})
  @operator = options[:operator]
  @operand = options[:operand]

  super
end

Instance Attribute Details

#operandExpression

Returns:



13
# File 'lib/expressir/model/expressions/unary_expression.rb', line 13

model_attr_accessor :operand, "Expression"

#operator:MINUS, ...

Returns:

  • (:MINUS, :NOT, :PLUS)


12
# File 'lib/expressir/model/expressions/unary_expression.rb', line 12

model_attr_accessor :operator, ":MINUS, :NOT, :PLUS"