Class: Dspace::Collection
- Inherits:
-
Object
- Object
- Dspace::Collection
- Includes:
- Builders::HashBuilder
- Defined in:
- lib/dspace/collection.rb
Instance Attribute Summary collapse
-
#copyright_text ⇒ Object
Returns the value of attribute copyright_text.
-
#expand ⇒ Object
readonly
Returns the value of attribute expand.
-
#handle ⇒ Object
readonly
Returns the value of attribute handle.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#introductory_text ⇒ Object
Returns the value of attribute introductory_text.
-
#items ⇒ Object
readonly
Returns the value of attribute items.
-
#license ⇒ Object
Returns the value of attribute license.
-
#link ⇒ Object
readonly
Returns the value of attribute link.
-
#logo ⇒ Object
Returns the value of attribute logo.
-
#name ⇒ Object
Returns the value of attribute name.
-
#number_items ⇒ Object
readonly
Returns the value of attribute number_items.
-
#parent_community ⇒ Object
readonly
Returns the value of attribute parent_community.
-
#parent_community_list ⇒ Object
readonly
Returns the value of attribute parent_community_list.
-
#short_description ⇒ Object
Returns the value of attribute short_description.
-
#sidebar_text ⇒ Object
Returns the value of attribute sidebar_text.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(args) ⇒ Collection
constructor
A new instance of Collection.
- #to_h ⇒ Object
Methods included from Builders::HashBuilder
Constructor Details
#initialize(args) ⇒ Collection
Returns a new instance of Collection.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/dspace/collection.rb', line 12 def initialize args @id = args['id'] @name = args['name'] @handle = args['handle'] @type = args['type'] @link = args['link'] @logo = args['logo'] @license = args['license'] @copyright_text = args['copyrightText'] @introductory_text = args['introductoryText'] @short_description = args['shortDescription'] @sidebar_text = args['sidebarText'] @number_items = args['numberItems'] @expand = args['expand'] @parent_community = Dspace::Community.new(args['parentCommunity']) unless args['parentCommunity'].nil? @parent_community_list = Dspace::Builders::ModelBuilder.build_communities(args['parentCommunityList']) @items = Dspace::Builders::ModelBuilder.build_items(args['items']) end |
Instance Attribute Details
#copyright_text ⇒ Object
Returns the value of attribute copyright_text.
5 6 7 |
# File 'lib/dspace/collection.rb', line 5 def copyright_text @copyright_text end |
#expand ⇒ Object (readonly)
Returns the value of attribute expand.
8 9 10 |
# File 'lib/dspace/collection.rb', line 8 def @expand end |
#handle ⇒ Object (readonly)
Returns the value of attribute handle.
8 9 10 |
# File 'lib/dspace/collection.rb', line 8 def handle @handle end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/dspace/collection.rb', line 8 def id @id end |
#introductory_text ⇒ Object
Returns the value of attribute introductory_text.
5 6 7 |
# File 'lib/dspace/collection.rb', line 5 def introductory_text @introductory_text end |
#items ⇒ Object (readonly)
Returns the value of attribute items.
8 9 10 |
# File 'lib/dspace/collection.rb', line 8 def items @items end |
#license ⇒ Object
Returns the value of attribute license.
5 6 7 |
# File 'lib/dspace/collection.rb', line 5 def license @license end |
#link ⇒ Object (readonly)
Returns the value of attribute link.
8 9 10 |
# File 'lib/dspace/collection.rb', line 8 def link @link end |
#logo ⇒ Object
Returns the value of attribute logo.
5 6 7 |
# File 'lib/dspace/collection.rb', line 5 def logo @logo end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/dspace/collection.rb', line 5 def name @name end |
#number_items ⇒ Object (readonly)
Returns the value of attribute number_items.
8 9 10 |
# File 'lib/dspace/collection.rb', line 8 def number_items @number_items end |
#parent_community ⇒ Object (readonly)
Returns the value of attribute parent_community.
8 9 10 |
# File 'lib/dspace/collection.rb', line 8 def parent_community @parent_community end |
#parent_community_list ⇒ Object (readonly)
Returns the value of attribute parent_community_list.
8 9 10 |
# File 'lib/dspace/collection.rb', line 8 def parent_community_list @parent_community_list end |
#short_description ⇒ Object
Returns the value of attribute short_description.
5 6 7 |
# File 'lib/dspace/collection.rb', line 5 def short_description @short_description end |
#sidebar_text ⇒ Object
Returns the value of attribute sidebar_text.
5 6 7 |
# File 'lib/dspace/collection.rb', line 5 def @sidebar_text end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
8 9 10 |
# File 'lib/dspace/collection.rb', line 8 def type @type end |
Instance Method Details
#to_h ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/dspace/collection.rb', line 32 def to_h { id: @id, name: @name, handle: @handle, type: @type, link: @link, logo: @logo, parentCommunity: @parent_community, parentCommunitList: @parent_community_list, items: obj2hash(@items), license: @license, copyrightText: @copyright_text, introductoryText: @introductory_text, shortDescription: @short_description, sidebarText: @sidebar_text, numberItems: @number_items, expand: @expand } end |