Class: ErlangConfig::ErlBinary
- Defined in:
- lib/erlang_config/erlbinary.rb
Instance Attribute Summary
Attributes inherited from ErlTerm
Instance Method Summary collapse
Methods inherited from ErlTerm
Constructor Details
This class inherits a constructor from ErlangConfig::ErlTerm
Instance Method Details
#to_ruby ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/erlang_config/erlbinary.rb', line 3 def to_ruby self.str.gsub!(/[<>]/,"") bin_els = self.str.split(",") els = bin_els.map { |el| if el[/^[0-9]+$/] el.to_i elsif el[/^"/] el.gsub(/"/,"") end } els.length > 1 ? els : els[0] end |