Class: Curly::AttributeScanner
- Inherits:
-
Object
- Object
- Curly::AttributeScanner
- Defined in:
- lib/curly/attribute_scanner.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(string) ⇒ AttributeScanner
constructor
A new instance of AttributeScanner.
- #scan ⇒ Object
Constructor Details
#initialize(string) ⇒ AttributeScanner
Returns a new instance of AttributeScanner.
12 13 14 |
# File 'lib/curly/attribute_scanner.rb', line 12 def initialize(string) @scanner = StringScanner.new(string) end |
Class Method Details
.scan(string) ⇒ Object
7 8 9 10 |
# File 'lib/curly/attribute_scanner.rb', line 7 def self.scan(string) return {} if string.nil? new(string).scan end |
Instance Method Details
#scan ⇒ Object
16 17 18 19 |
# File 'lib/curly/attribute_scanner.rb', line 16 def scan attributes = scan_attributes Hash[attributes] end |