Class: Dspace::Bitstream

Inherits:
Object
  • Object
show all
Includes:
Dspace::Builders::HashBuilder
Defined in:
lib/dspace/bitstream.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Dspace::Builders::HashBuilder

#obj2hash

Constructor Details

#initialize(args) ⇒ Bitstream

Returns a new instance of Bitstream.



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

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 = Dspace::Builders::ModelBuilder.build_policies(args['policies'])
  @expand = args['expand']
end

Instance Attribute Details

#bundle_nameObject

Returns the value of attribute bundle_name.



5
6
7
# File 'lib/dspace/bitstream.rb', line 5

def bundle_name
  @bundle_name
end

#check_sumObject (readonly)

Returns the value of attribute check_sum.



8
9
10
# File 'lib/dspace/bitstream.rb', line 8

def check_sum
  @check_sum
end

#descriptionObject

Returns the value of attribute description.



5
6
7
# File 'lib/dspace/bitstream.rb', line 5

def description
  @description
end

#formatObject

Returns the value of attribute format.



5
6
7
# File 'lib/dspace/bitstream.rb', line 5

def format
  @format
end

#idObject (readonly)

Returns the value of attribute id.



8
9
10
# File 'lib/dspace/bitstream.rb', line 8

def id
  @id
end

Returns the value of attribute link.



8
9
10
# File 'lib/dspace/bitstream.rb', line 8

def link
  @link
end

#mime_typeObject

Returns the value of attribute mime_type.



5
6
7
# File 'lib/dspace/bitstream.rb', line 5

def mime_type
  @mime_type
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/dspace/bitstream.rb', line 5

def name
  @name
end

#parent_objectObject (readonly)

Returns the value of attribute parent_object.



8
9
10
# File 'lib/dspace/bitstream.rb', line 8

def parent_object
  @parent_object
end

#policiesObject (readonly)

Returns the value of attribute policies.



8
9
10
# File 'lib/dspace/bitstream.rb', line 8

def policies
  @policies
end

Returns the value of attribute retrieve_link.



8
9
10
# File 'lib/dspace/bitstream.rb', line 8

def retrieve_link
  @retrieve_link
end

#sequence_idObject (readonly)

Returns the value of attribute sequence_id.



8
9
10
# File 'lib/dspace/bitstream.rb', line 8

def sequence_id
  @sequence_id
end

#size_bytesObject (readonly)

Returns the value of attribute size_bytes.



8
9
10
# File 'lib/dspace/bitstream.rb', line 8

def size_bytes
  @size_bytes
end

#typeObject (readonly)

Returns the value of attribute type.



8
9
10
# File 'lib/dspace/bitstream.rb', line 8

def type
  @type
end

Instance Method Details

#to_hObject



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

def to_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
  }
end