Class: WCKBAPI::Collection

Inherits:
Object
  • Object
show all
Defined in:
lib/wckbapi/collection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCollection

Returns a new instance of Collection.



6
7
# File 'lib/wckbapi/collection.rb', line 6

def initialize()
end

Instance Attribute Details

#avaiable_entriesObject

Returns the value of attribute avaiable_entries.



4
5
6
# File 'lib/wckbapi/collection.rb', line 4

def avaiable_entries
  @avaiable_entries
end

#collection_nameObject

Returns the value of attribute collection_name.



4
5
6
# File 'lib/wckbapi/collection.rb', line 4

def collection_name
  @collection_name
end

#collection_typeObject

Returns the value of attribute collection_type.



4
5
6
# File 'lib/wckbapi/collection.rb', line 4

def collection_type
  @collection_type
end

#collection_uidObject

Returns the value of attribute collection_uid.



4
5
6
# File 'lib/wckbapi/collection.rb', line 4

def collection_uid
  @collection_uid
end

#dbkeyObject

Returns the value of attribute dbkey.



4
5
6
# File 'lib/wckbapi/collection.rb', line 4

def dbkey
  @dbkey
end

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/wckbapi/collection.rb', line 4

def id
  @id
end

#openObject

Returns the value of attribute open.



4
5
6
# File 'lib/wckbapi/collection.rb', line 4

def open
  @open
end

#owner_institutionObject

Returns the value of attribute owner_institution.



4
5
6
# File 'lib/wckbapi/collection.rb', line 4

def owner_institution
  @owner_institution
end

#provider_nameObject

Returns the value of attribute provider_name.



4
5
6
# File 'lib/wckbapi/collection.rb', line 4

def provider_name
  @provider_name
end

#provider_uidObject

Returns the value of attribute provider_uid.



4
5
6
# File 'lib/wckbapi/collection.rb', line 4

def provider_uid
  @provider_uid
end

#selected_entriesObject

Returns the value of attribute selected_entries.



4
5
6
# File 'lib/wckbapi/collection.rb', line 4

def selected_entries
  @selected_entries
end

#sourceObject

Returns the value of attribute source.



4
5
6
# File 'lib/wckbapi/collection.rb', line 4

def source
  @source
end

#source_institutionObject

Returns the value of attribute source_institution.



4
5
6
# File 'lib/wckbapi/collection.rb', line 4

def source_institution
  @source_institution
end

#statusObject

Returns the value of attribute status.



4
5
6
# File 'lib/wckbapi/collection.rb', line 4

def status
  @status
end

#titleObject

Returns the value of attribute title.



4
5
6
# File 'lib/wckbapi/collection.rb', line 4

def title
  @title
end

#uriObject

Returns the value of attribute uri.



4
5
6
# File 'lib/wckbapi/collection.rb', line 4

def uri
  @uri
end

Instance Method Details

#load(item) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/wckbapi/collection.rb', line 8

def load(item)
	@id = item['id']
@title = item['title']
 	@provider_uid = item['kb:provider_uid']
	@provider_name = item['kb:provider_name']
	@available_entries = item['kb:available_entries']
	@selected_entries = item['kb:selected_entries']
	@collection_name = item['kb:collection_name']
	@collection_uid = item['kb:collection_uid']
	@owner_institution = item['kb:owner_institution']
	@source_institution = item['kb:source_institution']
	@status = item['kb:status']
	@dbkey = item['kb:dbkey']
	@source = item['kb:source']
	@open = item['kb:open']
	@collection_type = item['kb:collection_type']

    item['links'].each {|t|
       if t['rel'] == 'via'
          @uri = t['href']
          break
       end
    }
end