Class: Rmsgen::Inquirer

Inherits:
Object
  • Object
show all
Defined in:
lib/rmsgen/inquirer.rb

Constant Summary collapse

PARTS =
{ :url => /^http/, 
  :note =>/\[Link/,
    :duration => /^For.*week.*$/,
    :indendation => /^   / 
}

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(polnote, stdout = $stdout, answers = nil) ⇒ Inquirer

Returns a new instance of Inquirer.



11
12
13
14
15
16
17
18
19
# File 'lib/rmsgen/inquirer.rb', line 11

def initialize polnote, stdout=$stdout, answers=nil
  @parts_seen = []
  @polnote    = polnote
  @parts      = @polnote.parts
  @stdout     = stdout
  @script     = Script.new(stdout)
  @answers    = answers ||= []
  run!
end

Instance Attribute Details

#polnoteObject (readonly)

Returns the value of attribute polnote.



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

def polnote
  @polnote
end

Class Method Details

.inquire_about_note(note, stdout = $stdout) ⇒ Object



25
26
27
28
29
30
31
32
# File 'lib/rmsgen/inquirer.rb', line 25

def self.inquire_about_note(note, stdout=$stdout)
  stdout.puts note.body
  stdout.puts
  note.titleize
  note.inquire
  stdout.puts
  note
end

Instance Method Details

#bodyObject



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

def body
  @parts_seen.join PartGroup::DELIMETER 
end