Class: Solid::Arguments
- Inherits:
-
Object
- Object
- Solid::Arguments
- Includes:
- Enumerable
- Defined in:
- lib/solid/arguments.rb
Instance Attribute Summary collapse
-
#values ⇒ Object
Returns the value of attribute values.
Class Method Summary collapse
Instance Method Summary collapse
- #each(*args, &block) ⇒ Object
-
#initialize(string) ⇒ Arguments
constructor
A new instance of Arguments.
- #interpolate(context) ⇒ Object
- #parse! ⇒ Object
Constructor Details
#initialize(string) ⇒ Arguments
Returns a new instance of Arguments.
10 11 12 |
# File 'lib/solid/arguments.rb', line 10 def initialize(string) @string = string end |
Instance Attribute Details
#values ⇒ Object
Returns the value of attribute values.
8 9 10 |
# File 'lib/solid/arguments.rb', line 8 def values @values end |
Class Method Details
.parse(string) ⇒ Object
4 5 6 |
# File 'lib/solid/arguments.rb', line 4 def self.parse(string) new("[#{string}]").parse! end |
Instance Method Details
#each(*args, &block) ⇒ Object
19 20 21 |
# File 'lib/solid/arguments.rb', line 19 def each(*args, &block) values.each(*args, &block) end |
#interpolate(context) ⇒ Object
23 24 25 |
# File 'lib/solid/arguments.rb', line 23 def interpolate(context) values.evaluate(context) end |
#parse! ⇒ Object
14 15 16 17 |
# File 'lib/solid/arguments.rb', line 14 def parse! self.values = Solid::Parser.parse(@string) self end |