Class: Hazetug::CLI::Action

Inherits:
Object
  • Object
show all
Defined in:
lib/hazetug/cli/action.rb

Direct Known Subclasses

Bootstrap

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



6
7
8
# File 'lib/hazetug/cli/action.rb', line 6

def data
  @data
end

Class Method Details

.[](value) ⇒ Object



24
25
26
# File 'lib/hazetug/cli/action.rb', line 24

def [](value)
  @actions[value]
end

.inherited(child) ⇒ Object



18
19
20
21
22
# File 'lib/hazetug/cli/action.rb', line 18

def inherited(child)
  action = child.name.split('::').last.downcase.to_sym
  @actions ||= {}
  @actions[action] = child
end

Instance Method Details

#pass(hash = {}) ⇒ Object



12
13
14
15
# File 'lib/hazetug/cli/action.rb', line 12

def pass(hash={})
  @data = hash.dup
  self
end

#uiObject



8
9
10
# File 'lib/hazetug/cli/action.rb', line 8

def ui
  Hazetug::UI.instance
end