Class: LLT::Token::Punctuation
- Inherits:
-
LLT::Token
- Object
- LLT::Token
- LLT::Token::Punctuation
- Includes:
- XmlEscape
- Defined in:
- lib/llt/token/punctuation.rb
Instance Attribute Summary collapse
-
#closing ⇒ Object
Returns the value of attribute closing.
-
#opening ⇒ Object
Returns the value of attribute opening.
-
#other ⇒ Object
Returns the value of attribute other.
Attributes inherited from LLT::Token
Instance Method Summary collapse
- #as_xml ⇒ Object
-
#empty? ⇒ Boolean
(also: #no_forms?)
cannot hold anything atm, is therefore never really empty.
-
#initialize(string, id = nil) ⇒ Punctuation
constructor
A new instance of Punctuation.
- #inspect ⇒ Object
- #punctuation ⇒ Object
- #set_functions ⇒ Object
Methods inherited from LLT::Token
#==, #add_form, #add_forms, #has_special_role?, #set_special_role, #use
Constructor Details
#initialize(string, id = nil) ⇒ Punctuation
Returns a new instance of Punctuation.
12 13 14 15 16 17 18 19 20 |
# File 'lib/llt/token/punctuation.rb', line 12 def initialize(string, id = nil) super # this is part of an old interface that is mostly unused # some parts remain - find and delete em @string = xml_decode(string) @opening = false @closing = false @other = false end |
Instance Attribute Details
#closing ⇒ Object
Returns the value of attribute closing.
10 11 12 |
# File 'lib/llt/token/punctuation.rb', line 10 def closing @closing end |
#opening ⇒ Object
Returns the value of attribute opening.
10 11 12 |
# File 'lib/llt/token/punctuation.rb', line 10 def opening @opening end |
#other ⇒ Object
Returns the value of attribute other.
10 11 12 |
# File 'lib/llt/token/punctuation.rb', line 10 def other @other end |
Instance Method Details
#as_xml ⇒ Object
40 41 42 |
# File 'lib/llt/token/punctuation.rb', line 40 def as_xml xml_encode(@string) end |
#empty? ⇒ Boolean Also known as: no_forms?
cannot hold anything atm, is therefore never really empty
23 24 25 |
# File 'lib/llt/token/punctuation.rb', line 23 def empty? false end |
#inspect ⇒ Object
36 37 38 |
# File 'lib/llt/token/punctuation.rb', line 36 def inspect "#{"Punctuation token:".yellow} #{@string}" end |
#punctuation ⇒ Object
32 33 34 |
# File 'lib/llt/token/punctuation.rb', line 32 def punctuation @string end |
#set_functions ⇒ Object
28 29 30 |
# File 'lib/llt/token/punctuation.rb', line 28 def set_functions [:punctuation] end |