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.
10 11 12 13 14 15 |
# File 'lib/fig/tokenized_string/token.rb', line 10 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.
8 9 10 |
# File 'lib/fig/tokenized_string/token.rb', line 8 def raw_value @raw_value end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
7 8 9 |
# File 'lib/fig/tokenized_string/token.rb', line 7 def type @type end |
Instance Method Details
#to_double_quotable_string(metacharacters) ⇒ Object
25 26 27 |
# File 'lib/fig/tokenized_string/token.rb', line 25 def to_double_quotable_string() return raw_value end |
#to_escaped_string ⇒ Object
21 22 23 |
# File 'lib/fig/tokenized_string/token.rb', line 21 def to_escaped_string() return raw_value end |
#to_expanded_string(&block) ⇒ Object
17 18 19 |
# File 'lib/fig/tokenized_string/token.rb', line 17 def (&block) return block.call self end |
#to_single_quoted_string ⇒ Object
29 30 31 |
# File 'lib/fig/tokenized_string/token.rb', line 29 def to_single_quoted_string() raise NotImplementedError.new 'Cannot single-quote a token.' end |