Class: RubyKpi::Triple
- Inherits:
-
Object
- Object
- RubyKpi::Triple
- Defined in:
- lib/DataStructures.rb
Overview
The Triple class
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
accessor.
-
#predicate ⇒ Object
readonly
accessor.
-
#subject ⇒ Object
readonly
accessor.
Instance Method Summary collapse
-
#initialize(subject, predicate, object) ⇒ Triple
constructor
constructor.
-
#to_str ⇒ Object
to string.
Constructor Details
#initialize(subject, predicate, object) ⇒ Triple
constructor
67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/DataStructures.rb', line 67 def initialize(subject, predicate, object) # subject @subject = subject # predicate @predicate = predicate # object @object = object end |
Instance Attribute Details
#object ⇒ Object (readonly)
accessor
64 65 66 |
# File 'lib/DataStructures.rb', line 64 def object @object end |
#predicate ⇒ Object (readonly)
accessor
64 65 66 |
# File 'lib/DataStructures.rb', line 64 def predicate @predicate end |
#subject ⇒ Object (readonly)
accessor
64 65 66 |
# File 'lib/DataStructures.rb', line 64 def subject @subject end |
Instance Method Details
#to_str ⇒ Object
to string
81 82 83 84 85 |
# File 'lib/DataStructures.rb', line 81 def to_str() return "[" + @subject.to_str() + ", " + @predicate.to_str() + ", " + @object.to_str() + "]" end |