Class: Deltacloud::Exceptions::Exceptions

Inherits:
Object
  • Object
show all
Defined in:
lib/deltacloud/drivers/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ Exceptions

Returns a new instance of Exceptions.



184
185
186
187
188
# File 'lib/deltacloud/drivers/exceptions.rb', line 184

def initialize(&block)
  @exception_definitions = []
  instance_eval(&block) if block_given?
  self
end

Instance Attribute Details

#exception_definitionsObject (readonly)

Returns the value of attribute exception_definitions.



182
183
184
# File 'lib/deltacloud/drivers/exceptions.rb', line 182

def exception_definitions
  @exception_definitions
end

Instance Method Details

#on(*conditions, &block) ⇒ Object



190
191
192
# File 'lib/deltacloud/drivers/exceptions.rb', line 190

def on(*conditions, &block)
  @exception_definitions << ExceptionDef::new(conditions, &block) if block_given?
end