Class: Liquid::Tag::AttributeParser

Inherits:
Object
  • Object
show all
Defined in:
lib/liquid/tag/attribute_parser.rb,
lib/liquid/tag/attribute_parser/version.rb

Overview

:nodoc:

Constant Summary collapse

STRING_ATTRIBUTES =

TODO: Improve the key selecting regexp

/[^\s]+=(?:'[^']+')|[^\s]+=(?:"[^"]+")/.freeze
BOOLEAN_ATTRIBUTES =
/[^\s]+=(?:true|false)/.freeze
NUMBER_ATTRIBUTES =
/[^\s]+=(?:[+-]?(?:[0-9]*[.])?[0-9]+)/.freeze
VERSION =
"0.1.0"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw) ⇒ AttributeParser

Returns a new instance of AttributeParser.



15
16
17
18
19
20
# File 'lib/liquid/tag/attribute_parser.rb', line 15

def initialize(raw)
  @raw = raw
  @attributes = {}

  parse
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



13
14
15
# File 'lib/liquid/tag/attribute_parser.rb', line 13

def attributes
  @attributes
end