Class: Videojuicer::Resource::Errors

Inherits:
Hash show all
Defined in:
lib/videojuicer/resource/errors.rb

Instance Method Summary collapse

Methods inherited from Hash

#deep_merge, #deep_stringify, #deep_symbolize, #to_xml

Constructor Details

#initialize(error_hash) ⇒ Errors

Returns a new instance of Errors.



5
6
7
# File 'lib/videojuicer/resource/errors.rb', line 5

def initialize(error_hash)
  self.merge!(error_hash)
end

Instance Method Details

#on(key) ⇒ Object



9
10
11
12
13
# File 'lib/videojuicer/resource/errors.rb', line 9

def on(key)
  o = self[key.to_s]    
  o = (o.is_a?(Array))? o.uniq : [o]
  return (o.compact.empty?)? nil : o.compact
end