Exception: DomainNotFound

Inherits:
StandardError
  • Object
show all
Defined in:
lib/yodel/exceptions/domain_not_found.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(domain, port) ⇒ DomainNotFound

Returns a new instance of DomainNotFound.



3
4
5
6
7
# File 'lib/yodel/exceptions/domain_not_found.rb', line 3

def initialize(domain, port)
  @domain = domain
  @port = (port == 80 ? nil : port)
  super()
end

Instance Attribute Details

#domainObject (readonly)

Returns the value of attribute domain.



2
3
4
# File 'lib/yodel/exceptions/domain_not_found.rb', line 2

def domain
  @domain
end

Instance Method Details

#descriptionObject



13
14
15
# File 'lib/yodel/exceptions/domain_not_found.rb', line 13

def description
  "<form action='http://yodel#{':' if @port}#{@port}/sites' method='post' class='inline'><input type='hidden' name='name'' value='#{@domain}'><a href='#' onclick='submit()'>Create a new site</a></form> or try a different address."
end

#errorObject



9
10
11
# File 'lib/yodel/exceptions/domain_not_found.rb', line 9

def error
  ["The site '#{@domain.gsub('.yodel', '')}' has not been created yet"]
end