Class: Stylesheet::Document

Inherits:
Object
  • Object
show all
Defined in:
lib/stylesheet/document.rb

Instance Method Summary collapse

Constructor Details

#initialize(url = nil) ⇒ Document

Returns a new instance of Document.



4
5
6
# File 'lib/stylesheet/document.rb', line 4

def initialize(url=nil)
  @url = url
end

Instance Method Details

#locationObject



8
9
10
# File 'lib/stylesheet/document.rb', line 8

def location
  @location ||= Location.new(@url)
end

#location=(location) ⇒ Object



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

def location=(location)
  @location = location
end

#style_sheetsObject



20
21
22
# File 'lib/stylesheet/document.rb', line 20

def style_sheets
  @style_sheets ||= StyleSheetList.new(styles)
end

#textObject



16
17
18
# File 'lib/stylesheet/document.rb', line 16

def text 
  @text ||= request_content
end

#to_sObject



24
25
26
# File 'lib/stylesheet/document.rb', line 24

def to_s
  "#<Document location:#{location.href}>"
end