Class: Dspace::Community
- Inherits:
-
Object
- Object
- Dspace::Community
- Defined in:
- lib/dspace/community.rb
Instance Attribute Summary collapse
-
#collections ⇒ Object
readonly
Returns the value of attribute collections.
-
#copyright_text ⇒ Object
Returns the value of attribute copyright_text.
-
#count_items ⇒ Object
readonly
Returns the value of attribute count_items.
-
#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.
-
#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.
-
#parent_community ⇒ Object
readonly
Returns the value of attribute parent_community.
-
#short_description ⇒ Object
Returns the value of attribute short_description.
-
#sidebar_text ⇒ Object
Returns the value of attribute sidebar_text.
-
#sub_communities ⇒ Object
readonly
Returns the value of attribute sub_communities.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Community
constructor
A new instance of Community.
- #to_h ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ Community
Returns a new instance of Community.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/dspace/community.rb', line 10 def initialize(args={}) @id = args['id'] @name = args['name'] @handle = args['handle'] @type = args['type'] @link = args['link'] @logo = args['logo'] @parent_community = Dspace::Community.new(args['parentCommunity']) unless args['parentCommunity'].nil? @copyright_text = args['copyrightText'] @introductory_text = args['introductoryText'] @short_description = args['shortDescription'] @sidebar_text = args['sidebarText'] @count_items = args['countItems'] @sub_communities = Dspace::Builders::ModelBuilder.build_communities(args['subcommunities']) unless args['subcommunities'].nil? @collections = Dspace::Builders::ModelBuilder.build_collections(args['collections']) unless args['collections'].nil? @expand = args['expand'] end |
Instance Attribute Details
#collections ⇒ Object (readonly)
Returns the value of attribute collections.
7 8 9 |
# File 'lib/dspace/community.rb', line 7 def collections @collections end |
#copyright_text ⇒ Object
Returns the value of attribute copyright_text.
4 5 6 |
# File 'lib/dspace/community.rb', line 4 def copyright_text @copyright_text end |
#count_items ⇒ Object (readonly)
Returns the value of attribute count_items.
7 8 9 |
# File 'lib/dspace/community.rb', line 7 def count_items @count_items end |
#expand ⇒ Object (readonly)
Returns the value of attribute expand.
7 8 9 |
# File 'lib/dspace/community.rb', line 7 def @expand end |
#handle ⇒ Object (readonly)
Returns the value of attribute handle.
7 8 9 |
# File 'lib/dspace/community.rb', line 7 def handle @handle end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/dspace/community.rb', line 7 def id @id end |
#introductory_text ⇒ Object
Returns the value of attribute introductory_text.
4 5 6 |
# File 'lib/dspace/community.rb', line 4 def introductory_text @introductory_text end |
#link ⇒ Object (readonly)
Returns the value of attribute link.
7 8 9 |
# File 'lib/dspace/community.rb', line 7 def link @link end |
#logo ⇒ Object
Returns the value of attribute logo.
4 5 6 |
# File 'lib/dspace/community.rb', line 4 def logo @logo end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/dspace/community.rb', line 4 def name @name end |
#parent_community ⇒ Object (readonly)
Returns the value of attribute parent_community.
7 8 9 |
# File 'lib/dspace/community.rb', line 7 def parent_community @parent_community end |
#short_description ⇒ Object
Returns the value of attribute short_description.
4 5 6 |
# File 'lib/dspace/community.rb', line 4 def short_description @short_description end |
#sidebar_text ⇒ Object
Returns the value of attribute sidebar_text.
4 5 6 |
# File 'lib/dspace/community.rb', line 4 def @sidebar_text end |
#sub_communities ⇒ Object (readonly)
Returns the value of attribute sub_communities.
7 8 9 |
# File 'lib/dspace/community.rb', line 7 def sub_communities @sub_communities end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
7 8 9 |
# File 'lib/dspace/community.rb', line 7 def type @type end |
Instance Method Details
#to_h ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/dspace/community.rb', line 28 def to_h { id: @id, name: @name, handle: @handle, type: @type, link: @link, logo: @logo, parentCommunity: @parent_community, subcommunities: obj2hash(@sub_communities), collections: obj2hash(@collections), copyrightText: @copyright_text, introductoryText: @introductory_text, shortDescription: @short_description, sidebarText: @sidebar_text, countItems: @count_items, expand: @expand } end |