Class: Praxis::SimpleMediaType

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

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



3
4
5
# File 'lib/praxis/simple_media_type.rb', line 3

def identifier
  @identifier
end

Instance Method Details

#===(other_thing) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/praxis/simple_media_type.rb', line 8

def ===(other_thing)
  case other_thing
  when String
    identifier == other_thing
  when MediaType
    identifier == other_thing.identifier
  else
    raise 'can not compare'
  end
end

#describe(shallow = true) ⇒ Object



19
20
21
# File 'lib/praxis/simple_media_type.rb', line 19

def describe(shallow=true)
  {identifier: identifier}
end

#nameObject



4
5
6
# File 'lib/praxis/simple_media_type.rb', line 4

def name
  self.class.name
end