Class: AlmostHappy::Convertor::Renderer
- Inherits:
-
Struct
- Object
- Struct
- AlmostHappy::Convertor::Renderer
- Defined in:
- lib/almost_happy/convertor.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#options ⇒ Object
Returns the value of attribute options.
-
#renderer ⇒ Object
Returns the value of attribute renderer.
Instance Method Summary collapse
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
14 15 16 |
# File 'lib/almost_happy/convertor.rb', line 14 def name @name end |
#options ⇒ Object
Returns the value of attribute options
14 15 16 |
# File 'lib/almost_happy/convertor.rb', line 14 def @options end |
#renderer ⇒ Object
Returns the value of attribute renderer
14 15 16 |
# File 'lib/almost_happy/convertor.rb', line 14 def renderer @renderer end |
Instance Method Details
#[](key) ⇒ Object
16 17 18 |
# File 'lib/almost_happy/convertor.rb', line 16 def [](key) [key.to_sym] end |
#human_name ⇒ Object
24 25 26 |
# File 'lib/almost_happy/convertor.rb', line 24 def human_name ::I18n.t(name, :scope => :"almost_happy.renderers.human_names", :default => name.to_s.humanize) end |
#render(content) ⇒ Object
20 21 22 |
# File 'lib/almost_happy/convertor.rb', line 20 def render(content) renderer.call(content.to_s).to_s.html_safe end |