Class: FCSHD::Transcript

Inherits:
Object
  • Object
show all
Defined in:
lib/fcshd/transcript.rb,
lib/fcshd/transcript-item.rb,
lib/fcshd/transcript-parser.rb

Defined Under Namespace

Classes: Item, Parser

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTranscript

Returns a new instance of Transcript.



7
8
9
# File 'lib/fcshd/transcript.rb', line 7

def initialize
  @items = []
end

Instance Attribute Details

#n_compiled_filesObject

Returns the value of attribute n_compiled_files.



15
16
17
# File 'lib/fcshd/transcript.rb', line 15

def n_compiled_files
  @n_compiled_files
end

Class Method Details

.[](text) ⇒ Object



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

def self.[] text
  Parser.new(text.split("\n")).parse!
end

Instance Method Details

#<<(item) ⇒ Object



11
12
13
# File 'lib/fcshd/transcript.rb', line 11

def << item
  @items << item
end

#nothing_to_do?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/fcshd/transcript.rb', line 31

def nothing_to_do?
  n_compiled_files == 0
end

#succeeded=(value) ⇒ Object



17
# File 'lib/fcshd/transcript.rb', line 17

def succeeded= value; @succeeded = value; end

#succeeded?Boolean

Returns:

  • (Boolean)


18
# File 'lib/fcshd/transcript.rb', line 18

def succeeded?; @succeeded; end

#to_s(basedir) ⇒ Object



20
21
22
23
24
25
26
27
28
29
# File 'lib/fcshd/transcript.rb', line 20

def to_s(basedir)
  @items.map do |item|
    case item
    when Item
      item.to_s(basedir)
    else
      item
    end
  end.join
end