Module: Eco::Data::Hashes::DiffMeta::ClassMethods
- Defined in:
- lib/eco/data/hashes/diff_meta.rb
Instance Method Summary collapse
-
#case_sensitive(value = nil) ⇒ Object
Whether or not the diff calc of a node should be done case sensitive or insensitive.
-
#case_sensitive? ⇒ Boolean
Are comparisons of values done case sensitive?.
-
#compare(*attrs) ⇒ Array<String>
The comparable attributes.
-
#compared_attrs ⇒ Array<String>
The comparable attributes.
-
#key(value = nil) ⇒ String
The attribute that is key of the node diff elements.
-
#key? ⇒ Boolean
Is there a
keyattribute defined?.
Instance Method Details
#case_sensitive(value = nil) ⇒ Object
Whether or not the diff calc of a node should be done case sensitive or insensitive.
33 34 35 36 37 |
# File 'lib/eco/data/hashes/diff_meta.rb', line 33 def case_sensitive(value = nil) @case_sensitive = false unless instance_variable_defined?(:@case_sensitive) return @case_sensitive unless value @case_sensitive = !!value end |
#case_sensitive? ⇒ Boolean
Returns are comparisons of values done case sensitive?.
40 41 42 |
# File 'lib/eco/data/hashes/diff_meta.rb', line 40 def case_sensitive? !!@case_sensitive end |
#compare(*attrs) ⇒ Array<String>
Returns the comparable attributes.
27 28 29 30 |
# File 'lib/eco/data/hashes/diff_meta.rb', line 27 def compare(*attrs) compared_attrs.push(*attrs.map(&:to_s)).uniq! compared_attrs end |
#compared_attrs ⇒ Array<String>
Returns the comparable attributes.
45 46 47 |
# File 'lib/eco/data/hashes/diff_meta.rb', line 45 def compared_attrs @compared_attrs ||= [] end |
#key(value = nil) ⇒ String
Returns the attribute that is key of the node diff elements.
15 16 17 18 |
# File 'lib/eco/data/hashes/diff_meta.rb', line 15 def key(value = nil) return @key unless value @key = value.to_s end |
#key? ⇒ Boolean
Returns is there a key attribute defined?.
21 22 23 |
# File 'lib/eco/data/hashes/diff_meta.rb', line 21 def key? !!@key end |