Class: PostCL::Session
- Inherits:
-
Object
- Object
- PostCL::Session
- Defined in:
- lib/postcl.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#prompt ⇒ Object
readonly
Returns the value of attribute prompt.
-
#store ⇒ Object
readonly
Returns the value of attribute store.
Instance Method Summary collapse
- #error_exit(msg) ⇒ Object
-
#initialize(doc_parse) ⇒ Session
constructor
A new instance of Session.
Constructor Details
#initialize(doc_parse) ⇒ Session
Returns a new instance of Session.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/postcl.rb', line 13 def initialize(doc_parse) @args = doc_parse @prompt = TTY::Prompt.new @store = Store.new(self) @store.promt_list if @args["--lijst"] Command.validate_args(@args) begin Command.run(self) rescue Command::UnknownCommandError puts "ongelding commando" end end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
11 12 13 |
# File 'lib/postcl.rb', line 11 def args @args end |
#prompt ⇒ Object (readonly)
Returns the value of attribute prompt.
11 12 13 |
# File 'lib/postcl.rb', line 11 def prompt @prompt end |
#store ⇒ Object (readonly)
Returns the value of attribute store.
11 12 13 |
# File 'lib/postcl.rb', line 11 def store @store end |
Instance Method Details
#error_exit(msg) ⇒ Object
29 30 31 32 |
# File 'lib/postcl.rb', line 29 def error_exit(msg) puts msg exit 1 end |