Class: WonderScrape::Command

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/wonder_scrape/command.rb

Direct Known Subclasses

WonderScrape::Commands::Scrape

Instance Method Summary collapse

Instance Method Details

#command(**options) ⇒ Object

The external commands runner



26
27
28
29
# File 'lib/wonder_scrape/command.rb', line 26

def command(**options)
  require 'tty-command'
  TTY::Command.new(options)
end

#executeObject

Execute this command

Raises:

  • (NotImplementedError)


14
15
16
17
18
19
# File 'lib/wonder_scrape/command.rb', line 14

def execute(*)
  raise(
    NotImplementedError,
    "#{self.class}##{__method__} must be implemented"
  )
end

#promptObject

The interactive prompt



36
37
38
39
# File 'lib/wonder_scrape/command.rb', line 36

def prompt
  require 'tty-prompt'
  TTY::Prompt.new(interrupt: :exit)
end