Module: Virtus::Group::ClassMethods

Defined in:
lib/virtus/group.rb

Instance Method Summary collapse

Instance Method Details

#attribute_groupObject



31
32
33
# File 'lib/virtus/group.rb', line 31

def attribute_group
  self.attribute_groups.for_class(self)
end

#attribute_groupsObject



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