Class: Erlang::Map

Inherits:
Hash
  • Object
show all
Defined in:
lib/erlang/map.rb

Instance Method Summary collapse

Instance Method Details

#inspectObject



3
4
5
# File 'lib/erlang/map.rb', line 3

def inspect
  "#<#{self.class.name} \##{super}>"
end

#original_to_sObject



26
# File 'lib/erlang/map.rb', line 26

alias_method :original_to_s, :to_s

#pretty_inspectObject



7
8
9
# File 'lib/erlang/map.rb', line 7

def pretty_inspect
  "#<#{self.class.name} #{super[0..-2]}>\n"
end

#pretty_print(q) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/erlang/map.rb', line 11

def pretty_print(q)
  q.group(1, '#{', '}') {
    q.seplist(self, nil, :each_pair) { |k, v|
      q.group {
        q.pp k
        q.text ' => '
        q.group(1) {
          q.breakable ''
          q.pp v
        }
      }
    }
  }
end

#to_sObject



27
28
29
# File 'lib/erlang/map.rb', line 27

def to_s
  "\##{original_to_s}"
end