Class: Sunrise::Config::Group
- Includes:
- HasFields
- Defined in:
- lib/sunrise/config/group.rb
Instance Attribute Summary
Attributes inherited from Base
#abstract_model, #name, #parent
Instance Method Summary collapse
- #bottom? ⇒ Boolean
-
#initialize(abstract_model, parent, name = :default, options = nil) ⇒ Group
constructor
A new instance of Group.
- #sidebar? ⇒ Boolean
- #title ⇒ Object
Methods included from HasFields
#field, #fields, #nested_attributes
Methods inherited from Base
register_class_option, register_instance_option, #register_instance_option
Constructor Details
#initialize(abstract_model, parent, name = :default, options = nil) ⇒ Group
Returns a new instance of Group.
11 12 13 14 15 |
# File 'lib/sunrise/config/group.rb', line 11 def initialize(abstract_model, parent, name = :default, = nil) = { name: name }.merge( || {}) super(abstract_model, parent, ) @name = name.to_s.tr(' ', '_').downcase.to_sym end |
Instance Method Details
#bottom? ⇒ Boolean
27 28 29 |
# File 'lib/sunrise/config/group.rb', line 27 def bottom? @config_options[:holder] == :bottom end |
#sidebar? ⇒ Boolean
23 24 25 |
# File 'lib/sunrise/config/group.rb', line 23 def @config_options[:holder] == :sidebar end |
#title ⇒ Object
17 18 19 20 21 |
# File 'lib/sunrise/config/group.rb', line 17 def title return false if @config_options[:title] === false @config_options[:title] || I18n.t(@name, scope: [:manage, :groups]) end |