Exception: Guillotine::DuplicateCodeError

Inherits:
Error
  • Object
show all
Defined in:
lib/guillotine.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#codeObject (readonly)

Returns the value of attribute code.



12
13
14
# File 'lib/guillotine.rb', line 12

def code
  @code
end

#existing_urlObject (readonly)

Returns the value of attribute existing_url.



12
13
14
# File 'lib/guillotine.rb', line 12

def existing_url
  @existing_url
end

#new_urlObject (readonly)

Returns the value of attribute new_url.



12
13
14
# File 'lib/guillotine.rb', line 12

def new_url
  @new_url
end