Class: LLT::Token::Punctuation

Inherits:
LLT::Token show all
Defined in:
lib/llt/token/punctuation.rb

Instance Attribute Summary collapse

Attributes inherited from LLT::Token

#functions, #special_roles

Instance Method Summary collapse

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.



8
9
10
11
12
13
14
15
# File 'lib/llt/token/punctuation.rb', line 8

def initialize(string, id = nil)
  super
  # this is part of an old interface that is mostly unused
  # some parts remain - find and delete em
  @opening = false
  @closing = false
  @other   = false
end

Instance Attribute Details

#closingObject

Returns the value of attribute closing.



6
7
8
# File 'lib/llt/token/punctuation.rb', line 6

def closing
  @closing
end

#openingObject

Returns the value of attribute opening.



6
7
8
# File 'lib/llt/token/punctuation.rb', line 6

def opening
  @opening
end

#otherObject

Returns the value of attribute other.



6
7
8
# File 'lib/llt/token/punctuation.rb', line 6

def other
  @other
end

Instance Method Details

#empty?Boolean Also known as: no_forms?

cannot hold anything atm, is therefore never really empty

Returns:

  • (Boolean)


18
19
20
# File 'lib/llt/token/punctuation.rb', line 18

def empty?
  false
end

#inspectObject



31
32
33
# File 'lib/llt/token/punctuation.rb', line 31

def inspect
  "#{"Punctuation token:".yellow} #{@string}"
end

#punctuationObject



27
28
29
# File 'lib/llt/token/punctuation.rb', line 27

def punctuation
  @string
end

#set_functionsObject



23
24
25
# File 'lib/llt/token/punctuation.rb', line 23

def set_functions
  [:punctuation]
end