Class: Prawn::SVG::CSS::Stylesheets
- Inherits:
-
Object
- Object
- Prawn::SVG::CSS::Stylesheets
- Defined in:
- lib/prawn/svg/css/stylesheets.rb
Instance Attribute Summary collapse
-
#css_parser ⇒ Object
readonly
Returns the value of attribute css_parser.
-
#font_face_rules ⇒ Object
readonly
Returns the value of attribute font_face_rules.
-
#media ⇒ Object
readonly
Returns the value of attribute media.
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
-
#initialize(css_parser, root, media = :all, url_loader: nil, warnings: []) ⇒ Stylesheets
constructor
A new instance of Stylesheets.
- #load ⇒ Object
Constructor Details
#initialize(css_parser, root, media = :all, url_loader: nil, warnings: []) ⇒ Stylesheets
Returns a new instance of Stylesheets.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/prawn/svg/css/stylesheets.rb', line 5 def initialize(css_parser, root, media = :all, url_loader: nil, warnings: []) @css_parser = css_parser @root = root @media = media @warnings = warnings @font_face_rules = [] @has_url_loader = !url_loader.nil? install_url_loader_on_css_parser(url_loader) if url_loader end |
Instance Attribute Details
#css_parser ⇒ Object (readonly)
Returns the value of attribute css_parser.
3 4 5 |
# File 'lib/prawn/svg/css/stylesheets.rb', line 3 def css_parser @css_parser end |
#font_face_rules ⇒ Object (readonly)
Returns the value of attribute font_face_rules.
3 4 5 |
# File 'lib/prawn/svg/css/stylesheets.rb', line 3 def font_face_rules @font_face_rules end |
#media ⇒ Object (readonly)
Returns the value of attribute media.
3 4 5 |
# File 'lib/prawn/svg/css/stylesheets.rb', line 3 def media @media end |
#root ⇒ Object (readonly)
Returns the value of attribute root.
3 4 5 |
# File 'lib/prawn/svg/css/stylesheets.rb', line 3 def root @root end |
Instance Method Details
#load ⇒ Object
16 17 18 19 20 |
# File 'lib/prawn/svg/css/stylesheets.rb', line 16 def load load_style_elements xpath_styles = gather_xpath_styles associate_xpath_styles_with_elements(xpath_styles) end |