module Sunrise::Config::HasGroups
Public Instance Methods
group(name, options = nil, &block)
click to toggle source
Accessor for a group
If group with given name does not yet exist it will be created. If a block is passed it will be evaluated in the context of the group
# File lib/sunrise/config/has_groups.rb, line 12 def group(name, options = nil, &block) groups[name] ||= Sunrise::Config::Group.new(abstract_model, self, name, options) groups[name].instance_eval &block if block groups[name] end
groups()
click to toggle source
Reader for groups
# File lib/sunrise/config/has_groups.rb, line 19 def groups @groups ||= {} end
visible_groups()
click to toggle source
Reader for groups that are marked as visible
# File lib/sunrise/config/has_groups.rb, line 24 def visible_groups groups.select { |g| g.visible? } end