Class: BridgetownSvgInliner::LiquidAttributes
- Inherits:
-
Object
- Object
- BridgetownSvgInliner::LiquidAttributes
- Defined in:
- lib/bridgetown-svg-inliner/liquid_attributes.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ LiquidAttributes
constructor
A new instance of LiquidAttributes.
Constructor Details
#initialize(attributes) ⇒ LiquidAttributes
Returns a new instance of LiquidAttributes.
7 8 9 10 11 12 13 14 |
# File 'lib/bridgetown-svg-inliner/liquid_attributes.rb', line 7 def initialize(attributes) path, args = attributes.split(",", 2) @path = unescape_string(path) @args = args.scan(%r{([a-zA-Z0-9_\-]+)\s*:\s*(#{Liquid::QuotedFragment})}o).map do |arg| [arg[0], unescape_string(arg[1])] end.to_h if args.present? end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
5 6 7 |
# File 'lib/bridgetown-svg-inliner/liquid_attributes.rb', line 5 def args @args end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
5 6 7 |
# File 'lib/bridgetown-svg-inliner/liquid_attributes.rb', line 5 def path @path end |