Module: RIFCS::Activity

Includes:
RIFCS
Defined in:
lib/rif-cs/activity.rb

Instance Method Summary collapse

Methods included from RIFCS

addresses, camelize, coverage, electronic_addresses, existence_dates, list_of, locations, names, physical_addresses, related_info, related_objects, rights, spatials, subjects, temporals, #to_rif

Instance Method Details

#activity_keyObject



39
40
41
# File 'lib/rif-cs/activity.rb', line 39

def activity_key
  raise "Supply a activity_key attribute or implement a method"
end

#to_registry_node(encoding = 'UTF-8') ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/rif-cs/activity.rb', line 6

def to_registry_node(encoding='UTF-8')
  Nokogiri::XML::Builder.new(:encoding => encoding) do |xml|
    xml.registryObject_(:group => activity_group) do

      xml.key_ activity_key
      xml.originatingSource_ activity_originating_source if respond_to?(:activity_originating_source)

      xml.activity_(:dateModified => activity_date_modified, :type => activity_type) do
        RIFCS::list_of(activity_identifiers, :identifiers, xml) if respond_to?(:activity_identifiers)

        RIFCS::names(activity_names, xml) if respond_to?(:activity_names)

        RIFCS::locations(activity_locations, xml) if respond_to?(:activity_locations)

        RIFCS::coverage(activity_coverage, xml) if respond_to?(:activity_coverage)

        RIFCS::list_of(activity_descriptions, :descriptions, xml) if respond_to?(:activity_descriptions)

        RIFCS::existence_dates(activity_existence_dates, xml) if respond_to?(:activity_existence_dates)

        RIFCS::related_info(activity_related_info, xml) if respond_to?(:activity_related_infos)

        RIFCS::related_objects(activity_related_objects, xml) if respond_to?(:activity_related_objects)

        RIFCS::rights(activity_rights, xml) if respond_to?(:activity_rights)

        RIFCS::subjects(activity_subjects, xml) if respond_to?(:activity_subjects)

      end # activity
    end
  end
end