Class: Rmsgen::Inquirer

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

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.



5
6
7
8
9
10
11
12
13
# File 'lib/rmsgen/inquirer.rb', line 5

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.



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

def polnote
  @polnote
end

Class Method Details

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



19
20
21
22
23
24
25
26
# File 'lib/rmsgen/inquirer.rb', line 19

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



15
16
17
# File 'lib/rmsgen/inquirer.rb', line 15

def body
  @parts_seen.join PartGroup::DELIMETER 
end