Module: RDF::RDFObjects::AssertionSet

Defined in:
lib/rdf/rdfobjects/assertion_set.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/rdf/rdfobjects/assertion_set.rb', line 11

def method_missing(meth, *args)
  if meth.to_s =~ /\=$/
    send(:set_property, @vocabulary.send(meth.to_s.sub(/\=$/,'').to_sym), args)
  elsif prop = @vocabulary.send(meth)
    send(:"[]", prop)       
  end
end

Instance Attribute Details

#subjectObject

Returns the value of attribute subject.



3
4
5
# File 'lib/rdf/rdfobjects/assertion_set.rb', line 3

def subject
  @subject
end

#vocabularyObject

Returns the value of attribute vocabulary.



3
4
5
# File 'lib/rdf/rdfobjects/assertion_set.rb', line 3

def vocabulary
  @vocabulary
end

Instance Method Details

#[](key) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/rdf/rdfobjects/assertion_set.rb', line 19

def [](key)
 if self.keys.index(key.to_s)
   @subject[key]
 else
   send(:set_property, key, nil)
 end
end

#set_property(p, args) ⇒ Object



26
27
28
29
# File 'lib/rdf/rdfobjects/assertion_set.rb', line 26

def set_property(p, args)
  @subject[p] = args
  @subject[p]
end