Module: PubliSci::Prov::Element

Includes:
CustomPredicate, Vocabulary
Included in:
Activity, Agent, Association, Entity, Plan, Role, Usage
Defined in:
lib/publisci/metadata/prov/element.rb

Instance Method Summary collapse

Methods included from CustomPredicate

#add_custom, #custom, #has

Methods included from Vocabulary

#vocabulary

Instance Method Details

#__labelObject



31
32
33
34
# File 'lib/publisci/metadata/prov/element.rb', line 31

def __label
  raise "MissingInternalLabel: no __label for #{self.inspect}" unless @__label
  @__label
end

#__label=(l) ⇒ Object



27
28
29
# File 'lib/publisci/metadata/prov/element.rb', line 27

def __label=(l)
  @__label = l
end

#subject(s = nil) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/publisci/metadata/prov/element.rb', line 7

def subject(s=nil)
  if s
    if s.is_a? Symbol
      raise "subject generation from symbol not yet implemented!"
    else
      @subject = s
    end
  else
    @subject ||= generate_subject
  end
end

#subject=(s) ⇒ Object



19
20
21
# File 'lib/publisci/metadata/prov/element.rb', line 19

def subject=(s)
  @subject = s
end

#subject_idObject



23
24
25
# File 'lib/publisci/metadata/prov/element.rb', line 23

def subject_id
  self.class.to_s.split('::').last.downcase
end