Module: Hashie::Extensions::KeyReplace::ClassMethods

Defined in:
lib/thetvdb_api/utility/hashie/extensions/key_replace.rb

Instance Method Summary collapse

Instance Method Details

#key_replace(key) ⇒ Object



36
37
38
# File 'lib/thetvdb_api/utility/hashie/extensions/key_replace.rb', line 36

def key_replace(key)
  key_replaces[key.to_sym]
end

#key_replacesObject



32
33
34
# File 'lib/thetvdb_api/utility/hashie/extensions/key_replace.rb', line 32

def key_replaces
  @key_replaces || {}
end

#replace_key(*attrs) ⇒ Object



26
27
28
29
30
# File 'lib/thetvdb_api/utility/hashie/extensions/key_replace.rb', line 26

def replace_key(*attrs)
  @key_replaces ||= {}
  into = attrs.pop
  attrs.each { |key| @key_replaces[key] = into }
end