Class: Curlybars::Node::Literal
- Inherits:
-
Struct
- Object
- Struct
- Curlybars::Node::Literal
- Defined in:
- lib/curlybars/node/literal.rb
Instance Attribute Summary collapse
-
#literal ⇒ Object
Returns the value of attribute literal.
Instance Method Summary collapse
- #cache_key ⇒ Object
- #compile ⇒ Object
- #validate(branches, check_type: :anything) ⇒ Object
- #validate_as_value(branches) ⇒ Object
Instance Attribute Details
#literal ⇒ Object
Returns the value of attribute literal
3 4 5 |
# File 'lib/curlybars/node/literal.rb', line 3 def literal @literal end |
Instance Method Details
#cache_key ⇒ Object
20 21 22 23 24 25 |
# File 'lib/curlybars/node/literal.rb', line 20 def cache_key [ literal.to_s, self.class.name ].join("/") end |
#compile ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/curlybars/node/literal.rb', line 4 def compile # NOTE: the following is a heredoc string, representing the ruby code fragment # outputted by this node. <<-RUBY ->() { #{literal} } RUBY end |
#validate(branches, check_type: :anything) ⇒ Object
12 13 14 |
# File 'lib/curlybars/node/literal.rb', line 12 def validate(branches, check_type: :anything) # Nothing to validate here. end |
#validate_as_value(branches) ⇒ Object
16 17 18 |
# File 'lib/curlybars/node/literal.rb', line 16 def validate_as_value(branches) # It is always a value. end |