Class: ActiveFedora::Rdf::List::ListResource
- Defined in:
- lib/active_fedora/rdf/list.rb
Overview
This class is the graph/Resource that backs the List and supplies integration with the rest of ActiveFedora::Rdf
Instance Attribute Summary collapse
-
#list ⇒ Object
Returns the value of attribute list.
Attributes inherited from Resource
Attributes included from Properties
Instance Method Summary collapse
Methods inherited from Resource
#base_uri, #destroy, #destroy_child, #fetch, #fields, #final_parent, from_uri, #get_term, #get_values, #graph, #initialize, #mark_for_destruction, #marked_for_destruction?, #new_record?, #node?, #persist!, #persisted?, #rdf_label, #rdf_subject, #reload, #set_subject!, #set_value, #solrize, #to_term, #type, #type=, type_registry, #writable?
Methods included from Configurable
#base_uri, #configure, #rdf_label, #rdf_type, #repository, #transform_type, #type
Methods included from Properties
#config_for_term_or_uri, #fields, #map_predicates, #property
Constructor Details
This class inherits a constructor from ActiveFedora::Rdf::Resource
Instance Attribute Details
#list ⇒ Object
Returns the value of attribute list.
93 94 95 |
# File 'lib/active_fedora/rdf/list.rb', line 93 def list @list end |
Instance Method Details
#attributes=(values) ⇒ Object
99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/active_fedora/rdf/list.rb', line 99 def attributes=(values) raise ArgumentError, "values must be a Hash, you provided #{values.class}" unless values.kind_of? Hash values.with_indifferent_access.each do |key, value| if self.singleton_class.properties.keys.map{ |k| "#{k}_attributes"}.include?(key) klass = properties[key[0..-12]]['class_name'] klass = ActiveFedora.class_from_string(klass, final_parent.class) if klass.is_a? String value.is_a?(Hash) ? attributes_hash_to_list(values[key], klass) : attributes_to_list(value, klass) values.delete key end end persist! super end |