Class: REXML::HashableElementDelegator

Inherits:
Element
  • Object
show all
Defined in:
lib/xhtmldiff.rb

Instance Method Summary collapse

Constructor Details

#initialize(sub) ⇒ HashableElementDelegator

Returns a new instance of HashableElementDelegator.



26
27
28
# File 'lib/xhtmldiff.rb', line 26

def initialize(sub)
  super sub
end

Instance Method Details

#==(other) ⇒ Object



29
30
31
32
# File 'lib/xhtmldiff.rb', line 29

def == other
  res = other.to_s.strip == self.to_s.strip
  res
end

#[](k) ⇒ Object



38
39
40
41
42
43
44
45
# File 'lib/xhtmldiff.rb', line 38

def[](k)
  r = super
  if r.kind_of? __getobj__.class
    self.class.new(r)
  else
    r
  end
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/xhtmldiff.rb', line 34

def eql? other
  self == other
end

#hashObject



47
48
49
50
# File 'lib/xhtmldiff.rb', line 47

def hash
  r = __getobj__.to_s.hash
  r
end