Class: Oppen::Token::Break
- Inherits:
-
Oppen::Token
- Object
- Oppen::Token
- Oppen::Token::Break
- Defined in:
- lib/oppen/token.rb
Overview
Break Token.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#line_continuation ⇒ String
readonly
If a new line is needed, display this string before the new line.
-
#offset ⇒ Integer
readonly
Indentation.
-
#str ⇒ String
readonly
Break strings.
- #width ⇒ Integer readonly
Instance Method Summary collapse
-
#initialize(str = ' ', line_continuation: '', offset: 0, width: str.length) ⇒ Break
constructor
A new instance of Break.
-
#to_s ⇒ String
Convert token to String.
Constructor Details
#initialize(str = ' ', line_continuation: '', offset: 0, width: str.length) ⇒ Break
Returns a new instance of Break.
52 53 54 55 56 57 58 59 60 |
# File 'lib/oppen/token.rb', line 52 def initialize(str = ' ', line_continuation: '', offset: 0, width: str.length) raise ArgumentError, 'line_continuation cannot be nil' if line_continuation.nil? @line_continuation = line_continuation @offset = offset @str = str @width = width super() end |
Instance Attribute Details
#line_continuation ⇒ String (readonly)
Returns If a new line is needed, display this string before the new line.
44 45 46 |
# File 'lib/oppen/token.rb', line 44 def line_continuation @line_continuation end |
#offset ⇒ Integer (readonly)
Returns Indentation.
46 47 48 |
# File 'lib/oppen/token.rb', line 46 def offset @offset end |
#str ⇒ String (readonly)
Returns Break strings.
48 49 50 |
# File 'lib/oppen/token.rb', line 48 def str @str end |
#width ⇒ Integer (readonly)
50 51 52 |
# File 'lib/oppen/token.rb', line 50 def width @width end |