Class: Serenity::Line
- Inherits:
-
Object
- Object
- Serenity::Line
- Defined in:
- lib/serenity/serenity/line.rb
Instance Attribute Summary collapse
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(text) ⇒ Line
constructor
A new instance of Line.
- #to_s ⇒ Object
Constructor Details
#initialize(text) ⇒ Line
Returns a new instance of Line.
5 6 7 |
# File 'lib/serenity/serenity/line.rb', line 5 def initialize text @text = text end |
Instance Attribute Details
#text ⇒ Object (readonly)
Returns the value of attribute text.
3 4 5 |
# File 'lib/serenity/serenity/line.rb', line 3 def text @text end |
Class Method Details
.code(txt) ⇒ Object
17 18 19 |
# File 'lib/serenity/serenity/line.rb', line 17 def self.code txt CodeLine.new txt end |
.literal(txt) ⇒ Object
25 26 27 |
# File 'lib/serenity/serenity/line.rb', line 25 def self.literal txt LiteralLine.new txt end |
.string(txt) ⇒ Object
21 22 23 |
# File 'lib/serenity/serenity/line.rb', line 21 def self.string txt StringLine.new txt end |
Instance Method Details
#to_s ⇒ Object
9 10 11 |
# File 'lib/serenity/serenity/line.rb', line 9 def to_s @text end |