Class: Computering::Dsl::Text

Inherits:
Object
  • Object
show all
Defined in:
lib/computering/dsl/text.rb

Direct Known Subclasses

Command, Headline, Link

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ Text

Returns a new instance of Text.



3
4
5
6
# File 'lib/computering/dsl/text.rb', line 3

def initialize(text)
  @text   = text
  @buffer = ""
end

Class Method Details

.from_text(text) ⇒ Object



23
24
25
# File 'lib/computering/dsl/text.rb', line 23

def self.from_text(text)
  text.strip.split("\n").map { |line| self.new(line) }
end

Instance Method Details

#[](index) ⇒ Object



8
9
10
# File 'lib/computering/dsl/text.rb', line 8

def [](index)
  @text[index]
end

#blank?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/computering/dsl/text.rb', line 19

def blank?
  @text.nil? || @text.strip == ""
end

#bufferObject



15
16
17
# File 'lib/computering/dsl/text.rb', line 15

def buffer
  @buffer
end

#executeObject



12
13
# File 'lib/computering/dsl/text.rb', line 12

def execute
end