Class: Libis::Format::Info

Inherits:
Object
  • Object
show all
Defined in:
lib/libis/format/info.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, category:, description: '', puids: [], mimetypes: [], extensions: []) ⇒ Info

Returns a new instance of Info.



6
7
8
9
10
11
12
13
# File 'lib/libis/format/info.rb', line 6

def initialize(name:, category:, description: '', puids: [], mimetypes: [], extensions: [])
  @name = name
  @category = category
  @description = description
  @puids = puids
  @mimetypes = mimetypes
  @extensions = extensions
end

Instance Attribute Details

#categoryObject (readonly)

Returns the value of attribute category.



4
5
6
# File 'lib/libis/format/info.rb', line 4

def category
  @category
end

#descriptionObject (readonly)

Returns the value of attribute description.



4
5
6
# File 'lib/libis/format/info.rb', line 4

def description
  @description
end

#extensionsObject (readonly)

Returns the value of attribute extensions.



4
5
6
# File 'lib/libis/format/info.rb', line 4

def extensions
  @extensions
end

#mimetypesObject (readonly)

Returns the value of attribute mimetypes.



4
5
6
# File 'lib/libis/format/info.rb', line 4

def mimetypes
  @mimetypes
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/libis/format/info.rb', line 4

def name
  @name
end

#puidsObject (readonly)

Returns the value of attribute puids.



4
5
6
# File 'lib/libis/format/info.rb', line 4

def puids
  @puids
end

Instance Method Details

#to_hashObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/libis/format/info.rb', line 15

def to_hash
  {
      name: name,
      description: description.dup,
      category: category,
      puids: puids.dup,
      mimetypes: mimetypes.dup,
      extensions: extensions.dup
  }
end