Class: MakersToolbelt::CommandLine::Interface

Inherits:
Object
  • Object
show all
Defined in:
lib/makers_toolbelt/command_line/interface.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeInterface

Returns a new instance of Interface.



16
17
18
# File 'lib/makers_toolbelt/command_line/interface.rb', line 16

def initialize
  @answers = {}
end

Class Method Details

.ask_questions(question_set) ⇒ Object



12
13
14
# File 'lib/makers_toolbelt/command_line/interface.rb', line 12

def self.ask_questions(question_set)
  new.send(question_set)
end

Instance Method Details

#randomize_bytesObject



20
21
22
23
24
25
# File 'lib/makers_toolbelt/command_line/interface.rb', line 20

def randomize_bytes
  answers[:cohort_id] = GetPositiveNumber.call(question: "Enter cohort id: ")
  answers[:number_of_bytes] = GetPositiveNumber.call(question: "Enter required number of bytes: ")
  answers[:base_uri] = GetURI.call(question: "Enter base uri (press enter for #{HubClient::HUB_URL}): ")
  answers
end