Class: HaveAPI::Fs::Components::MetaOutput

Inherits:
Directory show all
Defined in:
lib/haveapi/fs/components/meta_output.rb

Constant Summary

Constants included from Help

Help::SEARCH_PATH

Instance Attribute Summary collapse

Attributes inherited from HaveAPI::Fs::Component

#atime, #context, #ctime, #mtime

Instance Method Summary collapse

Methods inherited from Directory

#directory?

Methods included from Help

find!, included

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, scope, data = nil, *args) ⇒ MetaOutput

Returns a new instance of MetaOutput.



8
9
10
11
12
13
14
# File 'lib/haveapi/fs/components/meta_output.rb', line 8

def initialize(action_dir, scope, data = nil, *args)
  super(*args)

  @action_dir = action_dir
  @scope = scope
  @data = data
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



5
6
7
# File 'lib/haveapi/fs/components/meta_output.rb', line 5

def data
  @data
end

#scopeObject (readonly)

Returns the value of attribute scope.



6
7
8
# File 'lib/haveapi/fs/components/meta_output.rb', line 6

def scope
  @scope
end

Instance Method Details

#contentsObject



16
17
18
19
20
21
22
# File 'lib/haveapi/fs/components/meta_output.rb', line 16

def contents
  ret = super
  return ret unless @data

  ret.concat(parameters.keys.map(&:to_s))
  ret
end

#parametersObject



24
25
26
# File 'lib/haveapi/fs/components/meta_output.rb', line 24

def parameters
  @action_dir.action.instance_variable_get('@spec')[:meta][@scope][:output][:parameters]
end

#titleObject



28
29
30
# File 'lib/haveapi/fs/components/meta_output.rb', line 28

def title
  'Output metadata parameters'
end