Class: Fig::TokenizedString::Token
- Inherits:
-
Object
- Object
- Fig::TokenizedString::Token
- Defined in:
- lib/fig/tokenized_string/token.rb
Instance Attribute Summary collapse
-
#raw_value ⇒ Object
readonly
Returns the value of attribute raw_value.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type, raw_value) ⇒ Token
constructor
A new instance of Token.
- #to_double_quotable_string(metacharacters) ⇒ Object
- #to_escaped_string ⇒ Object
- #to_expanded_string(&block) ⇒ Object
- #to_single_quoted_string ⇒ Object
Constructor Details
#initialize(type, raw_value) ⇒ Token
Returns a new instance of Token.
8 9 10 11 12 13 |
# File 'lib/fig/tokenized_string/token.rb', line 8 def initialize(type, raw_value) @type = type @raw_value = raw_value return end |
Instance Attribute Details
#raw_value ⇒ Object (readonly)
Returns the value of attribute raw_value.
6 7 8 |
# File 'lib/fig/tokenized_string/token.rb', line 6 def raw_value @raw_value end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/fig/tokenized_string/token.rb', line 5 def type @type end |
Instance Method Details
#to_double_quotable_string(metacharacters) ⇒ Object
23 24 25 |
# File 'lib/fig/tokenized_string/token.rb', line 23 def to_double_quotable_string() return raw_value end |
#to_escaped_string ⇒ Object
19 20 21 |
# File 'lib/fig/tokenized_string/token.rb', line 19 def to_escaped_string() return raw_value end |
#to_expanded_string(&block) ⇒ Object
15 16 17 |
# File 'lib/fig/tokenized_string/token.rb', line 15 def (&block) return block.call self end |
#to_single_quoted_string ⇒ Object
27 28 29 |
# File 'lib/fig/tokenized_string/token.rb', line 27 def to_single_quoted_string() raise NotImplementedError.new 'Cannot single-quote a token.' end |