Class: AdminIt::Section
- Inherits:
-
Object
- Object
- AdminIt::Section
- Extended by:
- ExtendIt::Base
- Includes:
- Iconed, Renderable, ExtendIt::Dsl
- Defined in:
- lib/admin_it/context/single_context.rb
Instance Attribute Summary collapse
-
#display_name ⇒ Object
readonly
Returns the value of attribute display_name.
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
- .attr_checker(*names) ⇒ Object extended from ExtendIt::Base
- .call_inherited(method_name, *args, base_first: false, &block) ⇒ Object extended from ExtendIt::Base
- .class_attr_reader(*attrs) ⇒ Object extended from ExtendIt::Base
- .inherited_class_reader(*names) ⇒ Object extended from ExtendIt::Base
- .metaclass(&block) ⇒ Object extended from ExtendIt::Base
Instance Method Summary collapse
- #dsl_eval(&block) ⇒ Object included from ExtendIt::Dsl
- #icon ⇒ Object included from Iconed
- #icon=(value) ⇒ Object included from Iconed
- #icon? ⇒ Boolean included from Iconed
-
#initialize(name, context, display_name: nil) ⇒ Section
constructor
A new instance of Section.
- #render(entity, instance = nil, &block) ⇒ Object included from Renderable
- #renderable? ⇒ Boolean included from Renderable
- #visible? ⇒ Boolean
Constructor Details
#initialize(name, context, display_name: nil) ⇒ Section
Returns a new instance of Section.
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/admin_it/context/single_context.rb', line 37 def initialize(name, context, display_name: nil) @name = name @display_name = display_name || name @context = context @fields = context.fields.map(&:field_name) context.sections.each do |section| next if section.name == name @fields -= section.fields end end |
Instance Attribute Details
#display_name ⇒ Object (readonly)
Returns the value of attribute display_name.
12 13 14 |
# File 'lib/admin_it/context/single_context.rb', line 12 def display_name @display_name end |
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
12 13 14 |
# File 'lib/admin_it/context/single_context.rb', line 12 def fields @fields end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
12 13 14 |
# File 'lib/admin_it/context/single_context.rb', line 12 def name @name end |
Class Method Details
.attr_checker(*names) ⇒ Object Originally defined in module ExtendIt::Base
.call_inherited(method_name, *args, base_first: false, &block) ⇒ Object Originally defined in module ExtendIt::Base
.class_attr_reader(*attrs) ⇒ Object Originally defined in module ExtendIt::Base
.inherited_class_reader(*names) ⇒ Object Originally defined in module ExtendIt::Base
.metaclass(&block) ⇒ Object Originally defined in module ExtendIt::Base
Instance Method Details
#dsl_eval(&block) ⇒ Object Originally defined in module ExtendIt::Dsl
#icon ⇒ Object Originally defined in module Iconed
#icon=(value) ⇒ Object Originally defined in module Iconed
#icon? ⇒ Boolean Originally defined in module Iconed
#render(entity, instance = nil, &block) ⇒ Object Originally defined in module Renderable
#renderable? ⇒ Boolean Originally defined in module Renderable
#visible? ⇒ Boolean
33 34 35 |
# File 'lib/admin_it/context/single_context.rb', line 33 def visible? @visible.nil? ? @visible = true : @visible == true end |