Class: Picobox::Box
- Inherits:
-
Object
- Object
- Picobox::Box
- Includes:
- Utils::Output, Utils::Visitable
- Defined in:
- lib/picobox/box.rb
Instance Attribute Summary collapse
-
#os ⇒ Object
readonly
Returns the value of attribute os.
Instance Method Summary collapse
-
#initialize(os) ⇒ Box
constructor
A new instance of Box.
- #install(type = nil) ⇒ Object
- #list ⇒ Object
Methods included from Utils::Output
#display_error, #display_info, #display_line, #display_status
Methods included from Utils::Visitable
Constructor Details
#initialize(os) ⇒ Box
Returns a new instance of Box.
8 9 10 |
# File 'lib/picobox/box.rb', line 8 def initialize(os) @os = os end |
Instance Attribute Details
#os ⇒ Object (readonly)
Returns the value of attribute os.
6 7 8 |
# File 'lib/picobox/box.rb', line 6 def os @os end |
Instance Method Details
#install(type = nil) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/picobox/box.rb', line 12 def install(type = nil) return if type.nil? accept(Commands::AddBox.new(type)) rescue Errors::BoxNotImplemented display_box_not_available type list # called like for exception handling rescue StandardError => e display_error e exit 1 end |
#list ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/picobox/box.rb', line 23 def list() accept(Commands::UpdatePackages.new) accept(Commands::ListBoxes.new) rescue StandardError => e display_error e exit 1 end |