Class: HaveAPI::Fs::Components::ActionInput
- Inherits:
-
Directory
- Object
- HaveAPI::Fs::Component
- Directory
- HaveAPI::Fs::Components::ActionInput
- Defined in:
- lib/haveapi/fs/components/action_input.rb
Constant Summary
Constants included from Help
Instance Attribute Summary collapse
-
#action_dir ⇒ Object
readonly
Returns the value of attribute action_dir.
Attributes inherited from HaveAPI::Fs::Component
#atime, #context, #ctime, #mtime
Instance Method Summary collapse
- #contents ⇒ Object
-
#initialize(action_dir, *args) ⇒ ActionInput
constructor
A new instance of ActionInput.
- #parameters ⇒ Object
- #title ⇒ Object
- #values ⇒ Object
Methods inherited from Directory
Methods included from Help
Methods inherited from HaveAPI::Fs::Component
#abspath, #bound=, #bound?, children_reader, component, #directory?, #executable?, #file?, #find, inherited, #invalid?, #invalidate, #parent, #path, #readable?, #reset, #setup, #times, #unsaved?, #use, #writable?
Constructor Details
#initialize(action_dir, *args) ⇒ ActionInput
Returns a new instance of ActionInput.
6 7 8 9 |
# File 'lib/haveapi/fs/components/action_input.rb', line 6 def initialize(action_dir, *args) super(*args) @action_dir = action_dir end |
Instance Attribute Details
#action_dir ⇒ Object (readonly)
Returns the value of attribute action_dir.
4 5 6 |
# File 'lib/haveapi/fs/components/action_input.rb', line 4 def action_dir @action_dir end |
Instance Method Details
#contents ⇒ Object
11 12 13 |
# File 'lib/haveapi/fs/components/action_input.rb', line 11 def contents super + parameters.keys.map(&:to_s) end |
#parameters ⇒ Object
15 16 17 |
# File 'lib/haveapi/fs/components/action_input.rb', line 15 def parameters @action_dir.action.input_params end |
#title ⇒ Object
23 24 25 |
# File 'lib/haveapi/fs/components/action_input.rb', line 23 def title 'Input parameters' end |
#values ⇒ Object
19 20 21 |
# File 'lib/haveapi/fs/components/action_input.rb', line 19 def values Hash[children.select { |n, c| c.is_a?(Parameter) && c.set? }.map { |n, c| [n, c.value] }] end |