Class: Para::FormBuilder::Tabs::Tab
- Inherits:
-
Object
- Object
- Para::FormBuilder::Tabs::Tab
- Defined in:
- lib/para/form_builder/tabs.rb
Instance Attribute Summary collapse
-
#builder ⇒ Object
readonly
Returns the value of attribute builder.
-
#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, builder, identifier, options, &content_block) ⇒ Tab
constructor
A new instance of Tab.
- #title ⇒ Object
Constructor Details
#initialize(template, object, builder, identifier, options, &content_block) ⇒ Tab
Returns a new instance of Tab.
35 36 37 38 39 40 41 42 |
# File 'lib/para/form_builder/tabs.rb', line 35 def initialize(template, object, builder, identifier, , &content_block) @template = template @object = object @builder = builder @identifier = identifier @content = capture { content_block.call } @icon = [:icon] end |
Instance Attribute Details
#builder ⇒ Object (readonly)
Returns the value of attribute builder.
31 32 33 |
# File 'lib/para/form_builder/tabs.rb', line 31 def builder @builder end |
#content ⇒ Object (readonly)
Returns the value of attribute content.
31 32 33 |
# File 'lib/para/form_builder/tabs.rb', line 31 def content @content end |
#icon ⇒ Object (readonly)
Returns the value of attribute icon.
31 32 33 |
# File 'lib/para/form_builder/tabs.rb', line 31 def icon @icon end |
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
31 32 33 |
# File 'lib/para/form_builder/tabs.rb', line 31 def identifier @identifier end |
#object ⇒ Object (readonly)
Returns the value of attribute object.
31 32 33 |
# File 'lib/para/form_builder/tabs.rb', line 31 def object @object end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
31 32 33 |
# File 'lib/para/form_builder/tabs.rb', line 31 def template @template end |
Instance Method Details
#dom_id ⇒ Object
52 53 54 55 56 57 58 |
# File 'lib/para/form_builder/tabs.rb', line 52 def dom_id @dom_id = [ 'form-tab', builder.nested_resource_dom_id.presence, identifier.to_s.parameterize ].compact.join('-') end |
#title ⇒ Object
44 45 46 47 48 49 50 |
# File 'lib/para/form_builder/tabs.rb', line 44 def title if Symbol === identifier ::I18n.t("forms.tabs.#{ object.class.model_name.i18n_key }.#{ identifier }") else identifier end end |