Class: Serenity::Line

Inherits:
Object
  • Object
show all
Defined in:
lib/serenity/line.rb

Direct Known Subclasses

CodeLine, TextLine

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ Line

Returns a new instance of Line.



5
6
7
# File 'lib/serenity/line.rb', line 5

def initialize text
  @text = text
end

Instance Attribute Details

#textObject (readonly)

Returns the value of attribute text.



3
4
5
# File 'lib/serenity/line.rb', line 3

def text
  @text
end

Class Method Details

.code(txt) ⇒ Object



17
18
19
# File 'lib/serenity/line.rb', line 17

def self.code txt
  CodeLine.new txt
end

.literal(txt) ⇒ Object



25
26
27
# File 'lib/serenity/line.rb', line 25

def self.literal txt
  LiteralLine.new txt
end

.string(txt) ⇒ Object



21
22
23
# File 'lib/serenity/line.rb', line 21

def self.string txt
  StringLine.new txt
end

.text(txt) ⇒ Object



13
14
15
# File 'lib/serenity/line.rb', line 13

def self.text txt
  TextLine.new txt
end

Instance Method Details

#to_sObject



9
10
11
# File 'lib/serenity/line.rb', line 9

def to_s
  @text
end