Class: ActiveFedora::Base
- Inherits:
-
Object
- Object
- ActiveFedora::Base
- Extended by:
- Querying, ActiveModel::Naming, ActiveSupport::DescendantsTracker
- Includes:
- Associations, Attributes, AutosaveAssociation, Callbacks, Core, Datastreams, FedoraAttributes, Indexing, NestedAttributes, Persistence, Rdf::Identifiable, Reflection, ReloadOnSave, Scoping, SemanticNode, Serialization, Sharding, Validations, ActiveModel::Conversion
- Defined in:
- lib/active_fedora/base.rb
Overview
This class ties together many of the lower-level modules, and implements something akin to an ActiveRecord-alike interface to fedora. If you want to represent a fedora object in the ruby space, this is the class you want to extend.
The Basics
class Oralhistory < ActiveFedora::Base
"properties", type: ActiveFedora::SimpleDatastream do |m|
m.field "narrator", :string
m.field "narrator", :text
end
end
The above example creates a Fedora object with a metadata datastream named “properties”, which is composed of a narrator and bio field.
Datastreams defined with has_metadata
are accessed via the datastreams
member hash.
Constant Summary
Constants included from AutosaveAssociation
AutosaveAssociation::ASSOCIATION_TYPES
Constants included from Callbacks
Instance Attribute Summary
Attributes included from ReloadOnSave
Attributes included from Core
Attributes included from Associations
Attributes included from SemanticNode
#load_from_solr, #relationships_loaded, #subject
Method Summary
Methods included from Querying
default_sort_params, extended, quote_for_solr
Methods included from Rdf::Identifiable
Methods included from ReloadOnSave
Methods included from FedoraAttributes
#create_date, #id, #label, #modified_date, #owner_id, #owner_id=, #pid, #state
Methods included from Core
#==, #adapt_to, #adapt_to_cmodel, #clone, #clone_into, #freeze, #frozen?, #init_with_object, #initialize, #pretty_pid, #reify, #reify!, #reload
Methods included from Serialization
Methods included from Attributes
#[], #[]=, #attributes, #attributes=, #inspect, #mark_as_changed, #value_has_changed?
Methods included from NestedAttributes
Methods included from AutosaveAssociation
#changed_for_autosave?, #mark_for_destruction, #marked_for_destruction?, #reload
Methods included from Associations
#association, #clear_association_cache
Methods included from Datastreams
#add_datastream, #add_disseminator_location_to_datastreams, #add_file_datastream, #configure_datastream, #create_datastream, #datastream_from_spec, #datastreams, #ds_specs, #load_datastreams, #metadata_streams, #rels_ext, #serialize_datastreams
Methods included from Callbacks
Methods included from Validations
#required?, #save, #save!, #valid?
Methods included from Indexing
#solr_name, #solrize_profile, #solrize_relationships, #to_solr, #update_index
Methods included from Persistence
#assert_content_model, #delete, #destroy, #destroyed?, #new?, #new_object?, #new_record?, #persisted?, #refresh, #save, #save!, #update
Methods included from SemanticNode
#add_relationship, #assert_kind_of, #clear_relationship, #clear_relationships, #conforms_to?, #ids_for_outbound, #internal_uri, #load_relationships, #object_relations, #relationships, #relationships=, #relationships_are_dirty?, #relationships_are_not_dirty!, #remove_relationship