Module: Boson::Commands::ViewCore

Extended by:
ViewCore
Included in:
ViewCore
Defined in:
lib/boson/commands/view_core.rb

Instance Method Summary collapse

Instance Method Details

#configObject



4
5
6
7
8
9
10
# File 'lib/boson/commands/view_core.rb', line 4

def config
  commands = {
    'render'=>{:desc=>"Render any object using Hirb"},
    'menu'=>{:desc=>"Provide a menu to multi-select elements from a given array"}
  }
  {:namespace=>false, :library_file=>File.expand_path(__FILE__), :commands=>commands}
end


16
17
18
# File 'lib/boson/commands/view_core.rb', line 16

def menu(arr, options={}, &block)
  Hirb::Console.format_output(arr, options.merge(:class=>"Hirb::Menu"), &block)
end

#render(object, options = {}) ⇒ Object



12
13
14
# File 'lib/boson/commands/view_core.rb', line 12

def render(object, options={})
  Boson::View.render(object, options)
end