Class: Webspinne::Site

Inherits:
Struct
  • Object
show all
Defined in:
lib/webspinne/site.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#uriObject

Returns the value of attribute uri

Returns:

  • (Object)

    the current value of uri



2
3
4
# File 'lib/webspinne/site.rb', line 2

def uri
  @uri
end

Instance Method Details

#hostname(test_uri = uri) ⇒ Object



11
12
13
# File 'lib/webspinne/site.rb', line 11

def hostname test_uri=uri
  URI(test_uri).hostname
end

#offsite?(test_uri) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/webspinne/site.rb', line 7

def offsite? test_uri
  !onsite?(test_uri)
end

#onsite?(test_uri) ⇒ Boolean

Returns:

  • (Boolean)


3
4
5
# File 'lib/webspinne/site.rb', line 3

def onsite? test_uri
  hostname == hostname(test_uri) || hostname(test_uri) == nil
end