Class: DSpaceRest::Bitstream

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Bitstream

Returns a new instance of Bitstream.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/dspacerest/bitstream.rb', line 11

def initialize args
  @id = args['id']
  @name = args['name']
  @type = args['type']
  @link = args['link']
  @bundle_name = args['bundleName']
  @description = args['description']
  @format = args['format']
  @mime_type = args['mimeType']
  @size_bytes = args['sizeBytes']
  @parent_object = args['parentObject']
  @retrieve_link = args['retrieveLink']
  @check_sum = args['checkSum']
  @sequence_id = args['sequenceId']
  @policies = DSpaceRest::Builders::ModelBuilder.build_policies(args['policies'])
  @expand = args['expand']
end

Instance Attribute Details

#bundle_nameObject

Returns the value of attribute bundle_name.



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

def bundle_name
  @bundle_name
end

#check_sumObject (readonly)

Returns the value of attribute check_sum.



7
8
9
# File 'lib/dspacerest/bitstream.rb', line 7

def check_sum
  @check_sum
end

#descriptionObject

Returns the value of attribute description.



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

def description
  @description
end

#formatObject

Returns the value of attribute format.



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

def format
  @format
end

#idObject (readonly)

Returns the value of attribute id.



7
8
9
# File 'lib/dspacerest/bitstream.rb', line 7

def id
  @id
end

Returns the value of attribute link.



7
8
9
# File 'lib/dspacerest/bitstream.rb', line 7

def link
  @link
end

#mime_typeObject

Returns the value of attribute mime_type.



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

def mime_type
  @mime_type
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#parent_objectObject (readonly)

Returns the value of attribute parent_object.



7
8
9
# File 'lib/dspacerest/bitstream.rb', line 7

def parent_object
  @parent_object
end

#policiesObject (readonly)

Returns the value of attribute policies.



7
8
9
# File 'lib/dspacerest/bitstream.rb', line 7

def policies
  @policies
end

Returns the value of attribute retrieve_link.



7
8
9
# File 'lib/dspacerest/bitstream.rb', line 7

def retrieve_link
  @retrieve_link
end

#sequence_idObject (readonly)

Returns the value of attribute sequence_id.



7
8
9
# File 'lib/dspacerest/bitstream.rb', line 7

def sequence_id
  @sequence_id
end

#size_bytesObject (readonly)

Returns the value of attribute size_bytes.



7
8
9
# File 'lib/dspacerest/bitstream.rb', line 7

def size_bytes
  @size_bytes
end

#typeObject (readonly)

Returns the value of attribute type.



7
8
9
# File 'lib/dspacerest/bitstream.rb', line 7

def type
  @type
end

Instance Method Details

#to_hObject



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/dspacerest/bitstream.rb', line 29

def to_h
  h = {
      id: @id,
      name: @name,
      type: @type,
      link: @link,
      bundleName: @bundle_name,
      description: @description,
      format: @format,
      mimeType: @mime_type,
      sizeBytes: @size_bytes,
      parentObject: @parent_object,
      retrieveLink: @retrieve_link,
      checkSum: @check_sum,
      sequenceId: @sequence_id,
      policies: @policies,
      expand: @expand
  }

  h
end