Class: Kanpachi::DSL::Error
- Inherits:
-
Object
- Object
- Kanpachi::DSL::Error
- Defined in:
- lib/kanpachi/dsl/error.rb
Instance Method Summary collapse
-
#description(description) ⇒ String
Sets the description.
-
#initialize(error, api_dsl) ⇒ Error
constructor
Constructor.
-
#response { ... } ⇒ Kanpachi::Response
Returns the error.
Constructor Details
#initialize(error, api_dsl) ⇒ Error
Constructor
8 9 10 11 |
# File 'lib/kanpachi/dsl/error.rb', line 8 def initialize(error, api_dsl) @error = error @api_dsl = api_dsl end |
Instance Method Details
#description(description) ⇒ String
Sets the description
18 19 20 |
# File 'lib/kanpachi/dsl/error.rb', line 18 def description(description) @error.description = description end |
#response { ... } ⇒ Kanpachi::Response
Returns the error
27 28 29 30 31 32 33 34 |
# File 'lib/kanpachi/dsl/error.rb', line 27 def response(&block) dsl = Response.new(@error.response) if block_given? dsl.instance_eval &block else @error.response end end |