Class: DYI::Stylesheet::Style
- Inherits:
-
Object
- Object
- DYI::Stylesheet::Style
- Defined in:
- lib/dyi/stylesheet.rb
Overview
Direct Known Subclasses
Instance Attribute Summary collapse
-
#body ⇒ String
readonly
Body of client scripting.
-
#content_type ⇒ String
readonly
Content-type of script.
- #media ⇒ Object readonly
- #title ⇒ Object readonly
Instance Method Summary collapse
-
#has_uri_reference? ⇒ Boolean
Returns this script includes reference of external script file.
- #include_external_file? ⇒ Boolean
-
#initialize(body, content_type = 'text/css', options = {}) ⇒ Style
constructor
A new instance of Style.
-
#write_as(formatter, io = $>) ⇒ Object
Writes the buffer contents of the object.
Constructor Details
#initialize(body, content_type = 'text/css', options = {}) ⇒ Style
Returns a new instance of Style.
43 44 45 46 47 48 |
# File 'lib/dyi/stylesheet.rb', line 43 def initialize(body, content_type='text/css', ={}) @content_type = content_type @body = body @media = [:media] @title = [:title] end |
Instance Attribute Details
#body ⇒ String (readonly)
Returns body of client scripting.
38 39 40 |
# File 'lib/dyi/stylesheet.rb', line 38 def body @body end |
#content_type ⇒ String (readonly)
Returns content-type of script.
36 37 38 |
# File 'lib/dyi/stylesheet.rb', line 36 def content_type @content_type end |
#media ⇒ Object (readonly)
39 40 41 |
# File 'lib/dyi/stylesheet.rb', line 39 def media @media end |
#title ⇒ Object (readonly)
39 40 41 |
# File 'lib/dyi/stylesheet.rb', line 39 def title @title end |
Instance Method Details
#has_uri_reference? ⇒ Boolean
Returns this script includes reference of external script file.
56 57 58 |
# File 'lib/dyi/stylesheet.rb', line 56 def has_uri_reference? false end |
#include_external_file? ⇒ Boolean
50 51 52 |
# File 'lib/dyi/stylesheet.rb', line 50 def include_external_file? false end |
#write_as(formatter, io = $>) ⇒ Object
Writes the buffer contents of the object.
63 64 65 |
# File 'lib/dyi/stylesheet.rb', line 63 def write_as(formatter, io=$>) formatter.write_style(self, io) end |