Module: Virtus::Group::ClassMethods
- Defined in:
- lib/virtus/group.rb
Instance Method Summary collapse
- #attribute_group ⇒ Object
- #attribute_groups ⇒ Object
- #group(name, &block) ⇒ Object
- #inherited(base) ⇒ Object
Instance Method Details
#attribute_group ⇒ Object
31 32 33 |
# File 'lib/virtus/group.rb', line 31 def attribute_group self.attribute_groups.for_class(self) end |
#attribute_groups ⇒ Object
35 36 37 |
# File 'lib/virtus/group.rb', line 35 def attribute_groups @attribute_groups ||= AttributeGroups.new end |
#group(name, &block) ⇒ Object
26 27 28 29 |
# File 'lib/virtus/group.rb', line 26 def group(name, &block) attribute_tracker = AttributeTracker.new(self, &block) attribute_group[name] = attribute_tracker.tracked_attributes end |
#inherited(base) ⇒ Object
39 40 41 42 |
# File 'lib/virtus/group.rb', line 39 def inherited(base) super base.attribute_group.merge!(self.attribute_group) end |