Method: SOCMaker::IfcSpc#encode_with

Defined in:
lib/soc_maker/ifc_spc.rb

#encode_with(coder) ⇒ Object

Encoder method (to yaml)

coder

An instance of the Psych::Coder to encode this class to a YAML file



76
77
78
79
80
81
82
# File 'lib/soc_maker/ifc_spc.rb', line 76

def encode_with( coder )
  init_error_if !coder.is_a?( Psych::Coder ), 
              'coder is not given as Psych::Coder'
  %w[ name ports multiplicity ].
        each { |v| coder[ v ] = instance_variable_get "@#{v}" }
  coder[ "id" ] = @id.to_s
end