Class: Para::FormBuilder::Tabs::Tab
- Inherits:
-
Object
- Object
- Para::FormBuilder::Tabs::Tab
- Defined in:
- lib/para/form_builder/tabs.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#icon ⇒ Object
readonly
Returns the value of attribute icon.
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
-
#object ⇒ Object
readonly
Returns the value of attribute object.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
Instance Method Summary collapse
- #dom_id ⇒ Object
-
#initialize(template, object, identifier, options, &content_block) ⇒ Tab
constructor
A new instance of Tab.
- #title ⇒ Object
Constructor Details
#initialize(template, object, identifier, options, &content_block) ⇒ Tab
Returns a new instance of Tab.
34 35 36 37 38 39 40 |
# File 'lib/para/form_builder/tabs.rb', line 34 def initialize(template, object, identifier, , &content_block) @template = template @object = object @identifier = identifier @content = capture { content_block.call } @icon = [:icon] end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
30 31 32 |
# File 'lib/para/form_builder/tabs.rb', line 30 def content @content end |
#icon ⇒ Object (readonly)
Returns the value of attribute icon.
30 31 32 |
# File 'lib/para/form_builder/tabs.rb', line 30 def icon @icon end |
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
30 31 32 |
# File 'lib/para/form_builder/tabs.rb', line 30 def identifier @identifier end |
#object ⇒ Object (readonly)
Returns the value of attribute object.
30 31 32 |
# File 'lib/para/form_builder/tabs.rb', line 30 def object @object end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
30 31 32 |
# File 'lib/para/form_builder/tabs.rb', line 30 def template @template end |
Instance Method Details
#dom_id ⇒ Object
50 51 52 |
# File 'lib/para/form_builder/tabs.rb', line 50 def dom_id @dom_id = identifier.to_s.parameterize end |
#title ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/para/form_builder/tabs.rb', line 42 def title if Symbol === identifier ::I18n.t("forms.tabs.#{ object.class.model_name.i18n_key }.#{ identifier }") else identifier end end |