Class: Mexico::Core::MediaType

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#extensionsObject

Returns the value of attribute extensions.



21
22
23
# File 'lib/mexico/core/media_type.rb', line 21

def extensions
  @extensions
end

#identifierObject

Returns the value of attribute identifier.



21
22
23
# File 'lib/mexico/core/media_type.rb', line 21

def identifier
  @identifier
end

#nameObject

Returns the value of attribute name.



21
22
23
# File 'lib/mexico/core/media_type.rb', line 21

def name
  @name
end