Class: MediaTypes::Registerable
- Inherits:
-
Object
- Object
- MediaTypes::Registerable
- Defined in:
- lib/media_types/registrar.rb
Instance Attribute Summary collapse
-
#aliases ⇒ Object
(also: #synonyms)
Returns the value of attribute aliases.
-
#media_type ⇒ Object
Returns the value of attribute media_type.
-
#symbol ⇒ Object
Returns the value of attribute symbol.
Instance Method Summary collapse
-
#initialize(media_type, symbol:, aliases: []) ⇒ Registerable
constructor
A new instance of Registerable.
- #to_s ⇒ Object (also: #mime_type)
- #to_sym ⇒ Object
Constructor Details
#initialize(media_type, symbol:, aliases: []) ⇒ Registerable
Returns a new instance of Registerable.
5 6 7 8 9 10 11 |
# File 'lib/media_types/registrar.rb', line 5 def initialize(media_type, symbol:, aliases: []) self.media_type = media_type self.symbol = symbol self.aliases = aliases freeze end |
Instance Attribute Details
#aliases ⇒ Object Also known as: synonyms
Returns the value of attribute aliases.
21 22 23 |
# File 'lib/media_types/registrar.rb', line 21 def aliases @aliases end |
#media_type ⇒ Object
Returns the value of attribute media_type.
21 22 23 |
# File 'lib/media_types/registrar.rb', line 21 def media_type @media_type end |
#symbol ⇒ Object
Returns the value of attribute symbol.
21 22 23 |
# File 'lib/media_types/registrar.rb', line 21 def symbol @symbol end |