Method: Xampl::XamplObject#===

Defined in:
lib/xamplr/xampl-object.rb

#===(other) ⇒ Object



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/xamplr/xampl-object.rb', line 120

def ===(other)
  accessed
  other.accessed if other
  return false unless self.class == other.class
  return false unless self.children.size == other.children.size
  self.children.zip(other.children).each do |c1, c2|
    return false unless c1.class == c2.class
    if c1.kind_of? String then
      return false unless c1 == c2
    else
      return false unless c1 === c2
    end
  end
  if (defined? self._content) and (defined? other._content) then
    return false unless self._content == other._content
  else
    return false if (defined? self._content) or (defined? other._content)
  end
  return true
end