Class: Habaki::Url
Overview
<url>/<uri> value type
Instance Attribute Summary
Attributes inherited from Value
Instance Method Summary collapse
-
#data_uri? ⇒ Boolean
is url of data type ?.
- #string(format = Formatter::Base.new) ⇒ String
- #uri ⇒ String
Methods inherited from Value
#==, #eql?, #hash, #initialize, #read_from_katana
Methods inherited from Node
Methods included from NodeReader
Constructor Details
This class inherits a constructor from Habaki::Value
Instance Method Details
#data_uri? ⇒ Boolean
is url of data type ?
303 304 305 |
# File 'lib/habaki/value.rb', line 303 def data_uri? @data.start_with?("data:") end |
#string(format = Formatter::Base.new) ⇒ String
314 315 316 |
# File 'lib/habaki/value.rb', line 314 def string(format = Formatter::Base.new) "url(#{@data.include?(" ") ? "#{format.quote}#{@data}#{format.quote}" : @data})" end |