Class: ErlangConfig::ErlTuple

Inherits:
ErlEnumeration show all
Defined in:
lib/erlang_config/erltuple.rb

Instance Attribute Summary

Attributes inherited from ErlEnumeration

#elements, #str

Instance Method Summary collapse

Methods inherited from ErlEnumeration

#get_element_strs, #initialize, #parse, #parse_element_strs, #parse_first_term, #pos_close_str

Constructor Details

This class inherits a constructor from ErlangConfig::ErlEnumeration

Instance Method Details

#to_rubyObject



3
4
5
6
7
8
9
# File 'lib/erlang_config/erltuple.rb', line 3

def to_ruby
  arr = @elements.map {|el|
    (el.is_a?(ErlTerm) || el.is_a?(ErlEnumeration))? el.to_ruby : el
  }
  key = arr.delete_at(0)
  hash = {key => ( arr.length>1 ? arr: arr[0])}
end