Class: HmxClient::Command::Fn
Overview
Load and Save functions in hmx
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#index ⇒ Object
fn.
-
#list ⇒ Object
fn:list.
-
#put ⇒ Object
fn:put.
Methods inherited from Base
#hmx, #initialize, #loadConfig!, namespace, #removeConfig, #storeConfig, #writeConfig
Methods included from Helpers
#display, #display_row, #display_table, #error, #getFromUser, #longest
Constructor Details
This class inherits a constructor from HmxClient::Command::Base
Instance Method Details
#index ⇒ Object
fn
Manipulate HMX functions
14 15 16 17 18 19 |
# File 'lib/hmx/command/fn.rb', line 14 def index unless args.size > 0 raise CommandFailed, "Usage: hmx fn <fnName>" end dout hmx.getFn([args.shift]) end |
#list ⇒ Object
fn:list
List all functions in HMX
25 26 27 28 29 30 |
# File 'lib/hmx/command/fn.rb', line 25 def list fns = hmx.query("fn", nil) fns.each { | f | display f.rpartition('/')[2] } end |
#put ⇒ Object
fn:put
Create or update a function
36 37 38 39 40 41 |
# File 'lib/hmx/command/fn.rb', line 36 def put unless args.size > 0 raise CommandFailed, "Usage: hmx fn:put <fnName> <f:function>" end dout hmx.putFn(args) end |