Class: AdminIt::Section
- Extended by:
- ExtendIt::Base
- Includes:
- 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
-
#initialize(name, context, display_name: nil) ⇒ Section
constructor
A new instance of Section.
- #render(entity, instance = nil, &block) ⇒ Object included from Renderable
- #visible? ⇒ Boolean
Constructor Details
#initialize(name, context, display_name: nil) ⇒ Section
Returns a new instance of Section.
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/admin_it/context/single_context.rb', line 31 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.
7 8 9 |
# File 'lib/admin_it/context/single_context.rb', line 7 def display_name @display_name end |
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
7 8 9 |
# File 'lib/admin_it/context/single_context.rb', line 7 def fields @fields end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/admin_it/context/single_context.rb', line 7 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
#render(entity, instance = nil, &block) ⇒ Object Originally defined in module Renderable
#visible? ⇒ Boolean
27 28 29 |
# File 'lib/admin_it/context/single_context.rb', line 27 def visible? @visible.nil? ? @visible = true : @visible == true end |