Class: CssCompare::CSS::Component::Base
- Inherits:
-
Object
- Object
- CssCompare::CSS::Component::Base
- Defined in:
- lib/css_compare/css/component/base.rb
Direct Known Subclasses
FontFace, Keyframes, KeyframesSelector, PageSelector, Property, Selector, Supports, Value
Instance Method Summary collapse
-
#==(this, that) ⇒ Boolean
Checks, whether two hashes are equal.
- #equals?(this, that) ⇒ Boolean
Instance Method Details
#==(this, that) ⇒ Boolean
Checks, whether two hashes are equal.
They are equal, if they contain the same keys and also have the same values assigned.
13 14 15 16 |
# File 'lib/css_compare/css/component/base.rb', line 13 def ==(this, that) keys = merge_keys(this, that) keys.all? { |key| this[key] && that[key] && this[key] == that[key] } end |
#equals?(this, that) ⇒ Boolean
18 19 20 21 |
# File 'lib/css_compare/css/component/base.rb', line 18 def equals?(this, that) keys = merge_keys(this, that) keys.all? { |key| this[key] && that[key] && this[key].equals?(that[key]) } end |