Class: DSpaceRest::Metadata

Inherits:
Object
  • Object
show all
Defined in:
lib/dspacerest/metadata.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Metadata

Returns a new instance of Metadata.



6
7
8
9
10
# File 'lib/dspacerest/metadata.rb', line 6

def initialize args
  @key = args['key']
  @value = args['value']
  @language = args['language'] || nil
end

Instance Attribute Details

#keyObject

Returns the value of attribute key.



4
5
6
# File 'lib/dspacerest/metadata.rb', line 4

def key
  @key
end

#languageObject

Returns the value of attribute language.



4
5
6
# File 'lib/dspacerest/metadata.rb', line 4

def language
  @language
end

#valueObject

Returns the value of attribute value.



4
5
6
# File 'lib/dspacerest/metadata.rb', line 4

def value
  @value
end

Instance Method Details

#to_hObject



12
13
14
# File 'lib/dspacerest/metadata.rb', line 12

def to_h
  {key: @key, value: @value, language: @language}
end