Class: Praxis::SimpleMediaType

Inherits:
Struct
  • Object
show all
Defined in:
lib/praxis/simple_media_type.rb

Overview

Stripped-down representation of an Internet Media Type where the structure and content of the type are unknown, or are defined externally to the Praxis application.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#identifierObject

Returns the value of attribute identifier

Returns:

  • (Object)

    the current value of identifier



8
9
10
# File 'lib/praxis/simple_media_type.rb', line 8

def identifier
  @identifier
end

Instance Method Details

#describe(shallow = true) ⇒ Object



17
18
19
# File 'lib/praxis/simple_media_type.rb', line 17

def describe(shallow=true)
  {name: name, family: "string", id: id, identifier: identifier}
end

#idObject



13
14
15
# File 'lib/praxis/simple_media_type.rb', line 13

def id
  self.class.name.gsub("::",'-')
end

#nameObject



9
10
11
# File 'lib/praxis/simple_media_type.rb', line 9

def name
  self.class.name
end