Class: FPM::Fry::Plugin::ScriptHelper::Script

Inherits:
Object
  • Object
show all
Defined in:
lib/fpm/fry/plugin/script_helper.rb

Direct Known Subclasses

AfterInstall, AfterRemove, BeforeInstall, BeforeRemove

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(renderer) ⇒ Script

Returns a new instance of Script.



8
9
10
# File 'lib/fpm/fry/plugin/script_helper.rb', line 8

def initialize(renderer)
  @renderer = renderer
end

Instance Attribute Details

#rendererObject (readonly)

Returns the value of attribute renderer.



6
7
8
# File 'lib/fpm/fry/plugin/script_helper.rb', line 6

def renderer
  @renderer
end

Instance Method Details

#nameObject



16
17
18
# File 'lib/fpm/fry/plugin/script_helper.rb', line 16

def name
  self.class.name.split('::').last.gsub(/([^A-Z])([A-Z])/,'\1_\2').downcase
end

#to_sObject



12
13
14
# File 'lib/fpm/fry/plugin/script_helper.rb', line 12

def to_s
  renderer.call(self)
end