Exception: Smash::CloudPowers::SmashError

Inherits:
Exception
  • Object
show all
Includes:
Singleton
Defined in:
lib/cloud_powers/smash_error.rb

Defined Under Namespace

Classes: ErrorCollection

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#error_collectionsObject (readonly)

Returns the value of attribute error_collections.



8
9
10
# File 'lib/cloud_powers/smash_error.rb', line 8

def error_collections
  @error_collections
end

#errorsObject (readonly)

Returns the value of attribute errors.



8
9
10
# File 'lib/cloud_powers/smash_error.rb', line 8

def errors
  @errors
end

Instance Method Details

#build!(*args) ⇒ Object



17
18
19
20
21
22
# File 'lib/cloud_powers/smash_error.rb', line 17

def build!(*args)

  @errors ||= args.inject({}) do |col, t|
    col.merge(t => ErrCol.new(t, 5, []))
  end
end

#push_error!(type, message) ⇒ Object



24
25
26
# File 'lib/cloud_powers/smash_error.rb', line 24

def push_error!(type, message)
  @errors[type].push!(message)
end