Class: FPM::Fry::Plugin::ScriptHelper::Script
- Inherits:
-
Object
- Object
- FPM::Fry::Plugin::ScriptHelper::Script
- Defined in:
- lib/fpm/fry/plugin/script_helper.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#renderer ⇒ Object
readonly
Returns the value of attribute renderer.
Instance Method Summary collapse
-
#initialize(renderer) ⇒ Script
constructor
A new instance of Script.
- #name ⇒ Object
- #to_s ⇒ Object
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
#renderer ⇒ Object (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
#name ⇒ Object
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_s ⇒ Object
12 13 14 |
# File 'lib/fpm/fry/plugin/script_helper.rb', line 12 def to_s renderer.call(self) end |