Class: Aspire::Object::Module
- Includes:
- Properties
- Defined in:
- lib/aspire/object/module.rb
Overview
Represents a module in the Aspire API
Constant Summary
Constants included from Properties
Properties::AIISO_CODE, Properties::AIISO_NAME, Properties::CREATED, Properties::DESCRIPTION, Properties::HAS_CREATOR, Properties::HAS_OWNER, Properties::LAST_PUBLISHED, Properties::LAST_UPDATED, Properties::NAME, Properties::PUBLISHED_BY, Properties::USED_BY
Constants inherited from Base
Constants included from Util
Instance Attribute Summary collapse
-
#code ⇒ String
The module code.
-
#name ⇒ String
The module name.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(uri, factory, json: nil, ld: nil) ⇒ Module
constructor
Initialises a new Module instance.
-
#to_s ⇒ String
Returns a string representation of the Module instance (the module name).
Methods inherited from Base
#get_boolean, #get_date, #get_property
Methods included from Util
#child_url?, #duration, #id_from_uri, #item?, #linked_data, #linked_data_path, #list?, #list_url?, #module?, #parent_url?, #parse_url, #resource?, #section?, #url_for_comparison, #url_path, #user?
Constructor Details
#initialize(uri, factory, json: nil, ld: nil) ⇒ Module
Initialises a new Module instance
19 20 21 22 23 24 25 26 27 |
# File 'lib/aspire/object/module.rb', line 19 def initialize(uri, factory, json: nil, ld: nil) super(uri, factory) self.code = get_property('code', json) || get_property(AIISO_CODE, ld) self.name = get_property('name', json) || get_property(AIISO_NAME, ld) end |
Instance Attribute Details
#code ⇒ String
Returns the module code.
12 13 14 |
# File 'lib/aspire/object/module.rb', line 12 def code @code end |
#name ⇒ String
Returns the module name.
16 17 18 |
# File 'lib/aspire/object/module.rb', line 16 def name @name end |
Instance Method Details
#to_s ⇒ String
Returns a string representation of the Module instance (the module name)
31 32 33 |
# File 'lib/aspire/object/module.rb', line 31 def to_s name.to_s || super end |