Class: Eco::Language::HashTransformModifier
Constant Summary
collapse
- FLAT_MODE =
[:flat, :non_recursivre]
- RECURSIVE_MODE =
[:recurse, :deep, :recursive, :r]
- COPY_MODE =
[:copy, :clone, :c]
- BANG_MODE =
[:!, :bang]
- COLON_MODE =
[:colon, :colon_to_key, :only_colon]
- ALL_TO_SYM =
[:all_to_sym, :all]
- STRINGIFY_MODE =
[:stringify, :string, :to_s]
- SYMBOLIZE_MODE =
[:symbolize, :sym, :to_sym]
- KEYS_MODE =
[:keys]
- NO_KEYS_MODE =
[:no_keys]
- NO_VALUES_MODE =
[:no_values]
- VALUES_MODE =
[:values]
Models::Modifier::DEFAULT_MODE
Instance Method Summary
collapse
#<, #<<, #default, #default?, #flush_mode, #initialize, #mode, #new, #reset
Instance Method Details
55
56
57
|
# File 'lib/eco/language/hash_transform_modifier.rb', line 55
def all
self.push(:all)
end
|
47
48
49
|
# File 'lib/eco/language/hash_transform_modifier.rb', line 47
def bang
self.push(:bang)
end
|
#clone? ⇒ Boolean
79
80
81
|
# File 'lib/eco/language/hash_transform_modifier.rb', line 79
def clone?
mode.all? { |m| !BANG_MODE.include?(m) }
end
|
51
52
53
|
# File 'lib/eco/language/hash_transform_modifier.rb', line 51
def colon
self.push(:colon)
end
|
#colon? ⇒ Boolean
83
84
85
|
# File 'lib/eco/language/hash_transform_modifier.rb', line 83
def colon?
mode.any? { |m| COLON_MODE.include?(m) }
end
|
43
44
45
|
# File 'lib/eco/language/hash_transform_modifier.rb', line 43
def copy
self.push(:copy)
end
|
67
68
69
|
# File 'lib/eco/language/hash_transform_modifier.rb', line 67
def keys
self.push(:keys)
end
|
#keys? ⇒ Boolean
91
92
93
|
# File 'lib/eco/language/hash_transform_modifier.rb', line 91
def keys?
mode.any? { |m| KEYS_MODE.include?(m) }
end
|
#non_recurse ⇒ Object
39
40
41
|
# File 'lib/eco/language/hash_transform_modifier.rb', line 39
def non_recurse
self.push(:flat)
end
|
35
36
37
|
# File 'lib/eco/language/hash_transform_modifier.rb', line 35
def recurse
self.push(:recurse)
end
|
#recurse? ⇒ Boolean
75
76
77
|
# File 'lib/eco/language/hash_transform_modifier.rb', line 75
def recurse?
mode.any? { |m| RECURSIVE_MODE.include?(m) }
end
|
#reset_bang ⇒ Object
27
28
29
|
# File 'lib/eco/language/hash_transform_modifier.rb', line 27
def reset_bang
self < self.mode - (BANG_MODE | COPY_MODE)
end
|
#reset_colon_mode ⇒ Object
31
32
33
|
# File 'lib/eco/language/hash_transform_modifier.rb', line 31
def reset_colon_mode
self < self.mode - (COLON_MODE | ALL_TO_SYM)
end
|
#reset_recursive ⇒ Object
23
24
25
|
# File 'lib/eco/language/hash_transform_modifier.rb', line 23
def reset_recursive
self < self.mode - (RECURSIVE_MODE | FLAT_MODE)
end
|
#stringify ⇒ Object
63
64
65
|
# File 'lib/eco/language/hash_transform_modifier.rb', line 63
def stringify
self.push(:stringify)
end
|
#symbolize ⇒ Object
59
60
61
|
# File 'lib/eco/language/hash_transform_modifier.rb', line 59
def symbolize
self.push(:symbolize)
end
|
#symbolize? ⇒ Boolean
87
88
89
|
# File 'lib/eco/language/hash_transform_modifier.rb', line 87
def symbolize?
mode.any? { |m| SYMBOLIZE_MODE.include?(m) }
end
|
71
72
73
|
# File 'lib/eco/language/hash_transform_modifier.rb', line 71
def values
self.push(:values)
end
|
#values? ⇒ Boolean
95
96
97
|
# File 'lib/eco/language/hash_transform_modifier.rb', line 95
def values?
mode.any? { |m| VALUES_MODE.include?(m) }
end
|