Class: Mexico::Core::MediaType
- Inherits:
-
Object
- Object
- Mexico::Core::MediaType
- Defined in:
- lib/mexico/core/media_type.rb
Overview
This file is part of the MExiCo gem. Copyright © 2012-2014 Peter Menke, SFB 673, Universität Bielefeld www.sfb673.org
MExiCo is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
MExiCo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with MExiCo. If not, see <www.gnu.org/licenses/>.
Instance Attribute Summary collapse
-
#extensions ⇒ Object
Returns the value of attribute extensions.
-
#identifier ⇒ Object
Returns the value of attribute identifier.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ MediaType
constructor
A new instance of MediaType.
Constructor Details
#initialize(opts = {}) ⇒ MediaType
Returns a new instance of MediaType.
23 24 25 26 27 |
# File 'lib/mexico/core/media_type.rb', line 23 def initialize(opts={}) [:identifier,:name,:extensions].each do |att| send("#{att}=", opts[att]) if opts.has_key?(att) end end |
Instance Attribute Details
#extensions ⇒ Object
Returns the value of attribute extensions.
21 22 23 |
# File 'lib/mexico/core/media_type.rb', line 21 def extensions @extensions end |
#identifier ⇒ Object
Returns the value of attribute identifier.
21 22 23 |
# File 'lib/mexico/core/media_type.rb', line 21 def identifier @identifier end |
#name ⇒ Object
Returns the value of attribute name.
21 22 23 |
# File 'lib/mexico/core/media_type.rb', line 21 def name @name end |