class Praxis::BlueprintAttributeGroup

Public Class Methods

construct(attribute_definition, options = {}) click to toggle source

Construct a new subclass, using attribute_definition to define attributes.

# File lib/praxis/blueprint_attribute_group.rb, line 10
def self.construct(attribute_definition, options = {})
  return self if attribute_definition.nil?

  # Construct a group-derived class with the given mediatype as the reference
  ::Class.new(self) do
    attributes(**options, &attribute_definition)
  end
end
constructable?() click to toggle source
# File lib/praxis/blueprint_attribute_group.rb, line 5
def self.constructable?
  true
end
for(media_type) click to toggle source
# File lib/praxis/blueprint_attribute_group.rb, line 19
def self.for(media_type)
  return media_type::AttributeGrouping if defined?(media_type::AttributeGrouping) # Cache the grouping class

  ::Class.new(self) do
    @media_type = media_type
  end
end