Exception: Guillotine::DuplicateCodeError
- Defined in:
- lib/guillotine.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#existing_url ⇒ Object
readonly
Returns the value of attribute existing_url.
-
#new_url ⇒ Object
readonly
Returns the value of attribute new_url.
Instance Method Summary collapse
-
#initialize(existing_url, new_url, code) ⇒ DuplicateCodeError
constructor
A new instance of DuplicateCodeError.
Constructor Details
#initialize(existing_url, new_url, code) ⇒ DuplicateCodeError
Returns a new instance of DuplicateCodeError.
14 15 16 17 18 19 |
# File 'lib/guillotine.rb', line 14 def initialize(existing_url, new_url, code) @existing_url = existing_url @new_url = new_url @code = code super "#{@new_url.inspect} was supposed to be shortened to #{@code.inspect}, but #{@existing_url.inspect} already is!" end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
12 13 14 |
# File 'lib/guillotine.rb', line 12 def code @code end |
#existing_url ⇒ Object (readonly)
Returns the value of attribute existing_url.
12 13 14 |
# File 'lib/guillotine.rb', line 12 def existing_url @existing_url end |
#new_url ⇒ Object (readonly)
Returns the value of attribute new_url.
12 13 14 |
# File 'lib/guillotine.rb', line 12 def new_url @new_url end |