Class: HaveAPI::Fs::Components::ActionOutput
- Inherits:
-
Directory
- Object
- HaveAPI::Fs::Component
- Directory
- HaveAPI::Fs::Components::ActionOutput
- Defined in:
- lib/haveapi/fs/components/action_output.rb
Constant Summary
Constants included from Help
Instance Attribute Summary collapse
-
#action_dir ⇒ Object
readonly
Returns the value of attribute action_dir.
-
#data ⇒ Object
Returns the value of attribute data.
Attributes inherited from HaveAPI::Fs::Component
#atime, #context, #ctime, #mtime
Instance Method Summary collapse
- #contents ⇒ Object
-
#initialize(action_dir, *args) ⇒ ActionOutput
constructor
A new instance of ActionOutput.
- #parameters ⇒ Object
- #title ⇒ 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) ⇒ ActionOutput
Returns a new instance of ActionOutput.
7 8 9 10 11 12 13 14 15 |
# File 'lib/haveapi/fs/components/action_output.rb', line 7 def initialize(action_dir, *args) super(*args) @action_dir = action_dir if %i(hash_list object_list).include?(@action_dir.action.output_layout.to_sym) @list = true end end |
Instance Attribute Details
#action_dir ⇒ Object (readonly)
Returns the value of attribute action_dir.
4 5 6 |
# File 'lib/haveapi/fs/components/action_output.rb', line 4 def action_dir @action_dir end |
#data ⇒ Object
Returns the value of attribute data.
5 6 7 |
# File 'lib/haveapi/fs/components/action_output.rb', line 5 def data @data end |
Instance Method Details
#contents ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/haveapi/fs/components/action_output.rb', line 17 def contents ret = super return ret unless @data if @list ret.concat(@data.map { |v| v.id.to_s }) else ret.concat(parameters.keys.map(&:to_s)) end ret end |
#parameters ⇒ Object
32 33 34 |
# File 'lib/haveapi/fs/components/action_output.rb', line 32 def parameters @action_dir.action.params end |
#title ⇒ Object
36 37 38 |
# File 'lib/haveapi/fs/components/action_output.rb', line 36 def title 'Output parameters' end |