Class: Triple
- Inherits:
-
Object
- Object
- Triple
- Defined in:
- lib/rena/triple.rb
Instance Attribute Summary collapse
-
#object ⇒ Object
Returns the value of attribute object.
-
#predicate ⇒ Object
Returns the value of attribute predicate.
-
#subject ⇒ Object
Returns the value of attribute subject.
Instance Method Summary collapse
-
#initialize(subject, predicate, object) ⇒ Triple
constructor
Creates a new triple directly from the intended subject, predicate, and object.
- #to_ntriples ⇒ Object
Constructor Details
#initialize(subject, predicate, object) ⇒ Triple
20 21 22 23 24 |
# File 'lib/rena/triple.rb', line 20 def initialize (subject, predicate, object) self.check_subject(subject) self.check_predicate(predicate) self.check_object(object) end |
Instance Attribute Details
#object ⇒ Object
Returns the value of attribute object.
2 3 4 |
# File 'lib/rena/triple.rb', line 2 def object @object end |
#predicate ⇒ Object
Returns the value of attribute predicate.
2 3 4 |
# File 'lib/rena/triple.rb', line 2 def predicate @predicate end |
#subject ⇒ Object
Returns the value of attribute subject.
2 3 4 |
# File 'lib/rena/triple.rb', line 2 def subject @subject end |
Instance Method Details
#to_ntriples ⇒ Object
26 27 28 |
# File 'lib/rena/triple.rb', line 26 def to_ntriples @subject.to_ntriples + " " + @predicate.to_ntriples + " " + @object.to_ntriples + " ." end |