Class: BrainDamage::View::Label::Base

Inherits:
Templateable::FieldTemplateable show all
Defined in:
lib/generators/brain_damage/lib/views/labels/base.rb

Direct Known Subclasses

Default

Instance Attribute Summary collapse

Attributes inherited from Templateable::FieldTemplateable

#partial_html, #type

Attributes inherited from Templateable::Base

#inner_html, #options, #template_file

Instance Method Summary collapse

Methods inherited from Templateable::FieldTemplateable

#empty_haml_path, #label_guard?, #method_missing, #render, #show?, #show_label?

Methods inherited from Templateable::Base

#indent, #method_missing, #render, #render_erb_file, #render_erb_string, #render_template_file

Constructor Details

#initialize(field, options) ⇒ Base

Returns a new instance of Base.



10
11
12
13
14
# File 'lib/generators/brain_damage/lib/views/labels/base.rb', line 10

def initialize(field, options)
  super

  @text = options[:text]
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class BrainDamage::Templateable::FieldTemplateable

Instance Attribute Details

#textObject (readonly)

Returns the value of attribute text.



8
9
10
# File 'lib/generators/brain_damage/lib/views/labels/base.rb', line 8

def text
  @text
end

Instance Method Details

#dirObject



20
21
22
# File 'lib/generators/brain_damage/lib/views/labels/base.rb', line 20

def dir
  __dir__
end

#rendered_textObject



16
17
18
# File 'lib/generators/brain_damage/lib/views/labels/base.rb', line 16

def rendered_text
  render_erb_string text
end