Class: Hookit::Resource::Warning

Inherits:
Base
  • Object
show all
Defined in:
lib/hookit/resource/warning.rb

Instance Attribute Summary

Attributes inherited from Base

#dict

Instance Method Summary collapse

Methods inherited from Base

#action, actions, #can_run?, default_action, #default_action, field, #not_if, #only_if

Constructor Details

#initialize(name) ⇒ Warning

Returns a new instance of Warning.



12
13
14
15
16
17
18
# File 'lib/hookit/resource/warning.rb', line 12

def initialize(name)
  source(name) unless source or content
  stream :stdout unless stream

  @default_header = "\u25BC\u25BC\u25BC\u25BC :: WARNING :: \u25BC\u25BC\u25BC\u25BC"
  @block_width = @default_header.length
end

Instance Method Details

#run(action) ⇒ Object



20
21
22
23
24
25
# File 'lib/hookit/resource/warning.rb', line 20

def run(action)
  case action
  when :warn
    warn!
  end
end