Method: Praxis::MediaTypeCollection.member_type

Defined in:
lib/praxis/media_type_collection.rb

.member_type(type = nil) ⇒ Object

Raises:

  • (ArgumentError)


41
42
43
44
45
46
47
# File 'lib/praxis/media_type_collection.rb', line 41

def self.member_type(type=nil)
  return ( @member_attribute ? @member_attribute.type : nil) unless type
  raise ArgumentError, "invalid type: #{type.name}" unless type < MediaType

  member_options = {}
  @member_attribute = Attributor::Attribute.new type, member_options
end