Class: Translink::CLI
- Inherits:
-
Object
- Object
- Translink::CLI
- Defined in:
- lib/translink/cli.rb
Constant Summary collapse
- RUNNABLE =
['help', 'scrape', 'version']
- URL =
'http://jp.translink.com.au/travel-information/network-information/buses/all-timetables'
Instance Attribute Summary collapse
-
#__crawler__ ⇒ Object
Returns the value of attribute __crawler__.
-
#out ⇒ Object
Returns the value of attribute out.
-
#pwd ⇒ Object
Returns the value of attribute pwd.
Instance Method Summary collapse
-
#initialize(pwd) ⇒ CLI
constructor
A new instance of CLI.
- #run(line) ⇒ Object
Constructor Details
Instance Attribute Details
#__crawler__ ⇒ Object
Returns the value of attribute __crawler__.
6 7 8 |
# File 'lib/translink/cli.rb', line 6 def __crawler__ @__crawler__ end |
#out ⇒ Object
Returns the value of attribute out.
6 7 8 |
# File 'lib/translink/cli.rb', line 6 def out @out end |
#pwd ⇒ Object
Returns the value of attribute pwd.
6 7 8 |
# File 'lib/translink/cli.rb', line 6 def pwd @pwd end |
Instance Method Details
#run(line) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/translink/cli.rb', line 14 def run line command, input = line.split /\s/, 2 if RUNNABLE.include? command send command, input else help nil end end |