Class: Expressir::Model::Statements::If

Inherits:
Expressir::Model::Statement show all
Defined in:
lib/expressir/model/statements/if.rb

Overview

Specified in ISO 10303-11:2004

  • section 13.7 If … Then … Else statement

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 = {}) ⇒ If

Returns a new instance of If.

Parameters:

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

Options Hash (options):



15
16
17
18
19
20
21
# File 'lib/expressir/model/statements/if.rb', line 15

def initialize(options = {})
  @expression = options[:expression]
  @statements = options[:statements] || []
  @else_statements = options[:else_statements] || []

  super
end

Instance Attribute Details

#else_statementsArray<Statement>

Returns:



9
# File 'lib/expressir/model/statements/if.rb', line 9

model_attr_accessor :else_statements, 'Array<Statement>'

#expressionExpression

Returns:



7
# File 'lib/expressir/model/statements/if.rb', line 7

model_attr_accessor :expression, 'Expression'

#statementsArray<Statement>

Returns:



8
# File 'lib/expressir/model/statements/if.rb', line 8

model_attr_accessor :statements, 'Array<Statement>'