Class: MakersToolbelt::RandomizeBytes

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

Constant Summary collapse

RANDOMIZE_BYTES_PATH =
-> (cohort_id) do
  "/api/v1/cohorts/#{cohort_id}/randomize_bytes" 
end

Instance Method Summary collapse

Constructor Details

#initialize(client: nil, interface: nil) ⇒ RandomizeBytes

Returns a new instance of RandomizeBytes.



14
15
16
17
# File 'lib/makers_toolbelt/randomize_bytes.rb', line 14

def initialize(client: nil, interface: nil)
  @interface = interface || CommandLine::Interface
  @client = client || HubClient.new
end

Instance Method Details

#runObject



19
20
21
22
23
# File 'lib/makers_toolbelt/randomize_bytes.rb', line 19

def run
  @options = interface.ask_questions(:randomize_bytes)
  response = client.post(**options) 
  output(response)
end