Class: RubyKpi::Triple

Inherits:
Object
  • Object
show all
Defined in:
lib/DataStructures.rb

Overview

The Triple class

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#objectObject (readonly)

accessor



64
65
66
# File 'lib/DataStructures.rb', line 64

def object
  @object
end

#predicateObject (readonly)

accessor



64
65
66
# File 'lib/DataStructures.rb', line 64

def predicate
  @predicate
end

#subjectObject (readonly)

accessor



64
65
66
# File 'lib/DataStructures.rb', line 64

def subject
  @subject
end

Instance Method Details

#to_strObject

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