class Eco::Language::HashTransformModifier

Constants

ALL_TO_SYM
BANG_MODE
COLON_MODE
COPY_MODE
FLAT_MODE
KEYS_MODE
NO_KEYS_MODE
NO_VALUES_MODE
RECURSIVE_MODE
STRINGIFY_MODE
SYMBOLIZE_MODE
VALUES_MODE

Public Instance Methods

all() click to toggle source
# File lib/eco/language/hash_transform_modifier.rb, line 55
def all
  self.push(:all)
end
bang() click to toggle source
# File lib/eco/language/hash_transform_modifier.rb, line 47
def bang
  self.push(:bang)
end
clone?() click to toggle source
# File lib/eco/language/hash_transform_modifier.rb, line 79
def clone?
  mode.all? { |m| !BANG_MODE.include?(m) }
end
colon() click to toggle source
# File lib/eco/language/hash_transform_modifier.rb, line 51
def colon
  self.push(:colon)
end
colon?() click to toggle source
# File lib/eco/language/hash_transform_modifier.rb, line 83
def colon?
  mode.any? { |m| COLON_MODE.include?(m) }
end
copy() click to toggle source
# File lib/eco/language/hash_transform_modifier.rb, line 43
def copy
  self.push(:copy)
end
keys() click to toggle source
# File lib/eco/language/hash_transform_modifier.rb, line 67
def keys
  self.push(:keys)
end
keys?() click to toggle source
# File lib/eco/language/hash_transform_modifier.rb, line 91
def keys?
  mode.any? { |m| KEYS_MODE.include?(m) }
end
non_recurse() click to toggle source
# File lib/eco/language/hash_transform_modifier.rb, line 39
def non_recurse
  self.push(:flat)
end
recurse() click to toggle source
# File lib/eco/language/hash_transform_modifier.rb, line 35
def recurse
  self.push(:recurse)
end
recurse?() click to toggle source
# File lib/eco/language/hash_transform_modifier.rb, line 75
def recurse?
  mode.any? { |m| RECURSIVE_MODE.include?(m) }
end
reset_bang() click to toggle source
# File lib/eco/language/hash_transform_modifier.rb, line 27
def reset_bang
  self < self.mode - (BANG_MODE | COPY_MODE)
end
reset_colon_mode() click to toggle source
# 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() click to toggle source
# File lib/eco/language/hash_transform_modifier.rb, line 23
def reset_recursive
  self < self.mode - (RECURSIVE_MODE | FLAT_MODE)
end
stringify() click to toggle source
# File lib/eco/language/hash_transform_modifier.rb, line 63
def stringify
  self.push(:stringify)
end
symbolize() click to toggle source
# File lib/eco/language/hash_transform_modifier.rb, line 59
def symbolize
  self.push(:symbolize)
end
symbolize?() click to toggle source
# File lib/eco/language/hash_transform_modifier.rb, line 87
def symbolize?
  mode.any? { |m| SYMBOLIZE_MODE.include?(m) }
end
values() click to toggle source
# File lib/eco/language/hash_transform_modifier.rb, line 71
def values
  self.push(:values)
end
values?() click to toggle source
# File lib/eco/language/hash_transform_modifier.rb, line 95
def values?
  mode.any? { |m| VALUES_MODE.include?(m) }
end

Protected Instance Methods

resolve_mode() click to toggle source
# File lib/eco/language/hash_transform_modifier.rb, line 101
def resolve_mode
  modifiers = self.to_a
  modifiers = resolve(modifiers, RECURSIVE_MODE | FLAT_MODE)
  modifiers = resolve(modifiers, BANG_MODE | COPY_MODE)
  modifiers = resolve(modifiers, COLON_MODE | ALL_TO_SYM)
  modifiers = resolve(modifiers, STRINGIFY_MODE | SYMBOLIZE_MODE)
  modifiers = resolve(modifiers, KEYS_MODE | NO_KEYS_MODE)
  modifiers = resolve(modifiers, VALUES_MODE | NO_VALUES_MODE)
  modifiers
end