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 = ' ', width: str.length, line_continuation: '', offset: 0) ⇒ Break
constructor
A new instance of Break.
- #to_s ⇒ String
Constructor Details
#initialize(str = ' ', width: str.length, line_continuation: '', offset: 0) ⇒ Break
Returns a new instance of Break.
59 60 61 62 63 64 65 66 67 |
# File 'lib/oppen/token.rb', line 59 def initialize(str = ' ', width: str.length, line_continuation: '', offset: 0) 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.
51 52 53 |
# File 'lib/oppen/token.rb', line 51 def line_continuation @line_continuation end |
#offset ⇒ Integer (readonly)
Returns Indentation.
53 54 55 |
# File 'lib/oppen/token.rb', line 53 def offset @offset end |
#str ⇒ String (readonly)
Returns Break strings.
55 56 57 |
# File 'lib/oppen/token.rb', line 55 def str @str end |
#width ⇒ Integer (readonly)
57 58 59 |
# File 'lib/oppen/token.rb', line 57 def width @width end |