Class: HashDealer::Hash
Instance Method Summary
collapse
Methods inherited from Hash
#matcher, #pathify_strings
Constructor Details
#initialize(optional_attributes = []) ⇒ Hash
Returns a new instance of Hash.
4
5
6
|
# File 'lib/hash.rb', line 4
def initialize(optional_attributes = [])
@optional_attributes = optional_attributes
end
|
Instance Method Details
#==(other) ⇒ Object
15
16
17
|
# File 'lib/hash.rb', line 15
def ==(other)
return self.eql?(other)
end
|
#eql?(other) ⇒ Boolean
8
9
10
11
12
13
|
# File 'lib/hash.rb', line 8
def eql?(other)
self_for_comparison = self.remove_optional_keys(self)
other_for_comparison = self.remove_optional_keys(other)
self_for_comparison.eql?(other_for_comparison)
end
|
19
20
21
22
23
24
25
|
# File 'lib/hash.rb', line 19
def to_hash
ret = ::Hash.new
self.each_pair do |k,v|
ret[k] = v
end
ret
end
|