Class: HaveAPI::Fs::Components::ActionErrors

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

Defined Under Namespace

Classes: ActionError

Constant Summary

Constants included from Help

Help::SEARCH_PATH

Instance Attribute Summary

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, *args) ⇒ ActionErrors

Returns a new instance of ActionErrors.



15
16
17
18
# File 'lib/haveapi/fs/components/action_errors.rb', line 15

def initialize(action_dir, *args)
  super(*args)
  @action_dir = action_dir
end

Instance Method Details

#contentsObject



20
21
22
23
24
25
# File 'lib/haveapi/fs/components/action_errors.rb', line 20

def contents
  ret = super
  return ret unless @errors
  ret.concat(@errors.keys.map(&:to_s))
  ret
end

#set(errors) ⇒ Object



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

def set(errors)
  changed
  @errors = errors
end

#titleObject



32
33
34
# File 'lib/haveapi/fs/components/action_errors.rb', line 32

def title
  'Errors'
end