lib/model/the_class.rb
Suppose that you created a graph where vertexes month is connected with
the vertexes day by the edge TIMEOF.
Suppose we want to find all the days in the first month and in the third month..

Usually we can do in the following way.

  ORD.create_class :month
  (.. put some records into Month ... )
  firstmonth = Month.first
  thirdmonth = Month.all[2]
  days_firstmonth = firstmonth.out_TIMEOF.map{|x| x.in}
  days_thirdmonth = thirdmonth.out_TIMEOF.map{|x| x.in}

However we can obtain the same result with the following command

  Month.add_edge_link name: "days", direction: "out", edge: TIME_OF
  firstmonth = month.first
  thirdmonth = month.all[2]
  days_firstmonth = firstmonth.days
  days_thirdmonth = thirdmonth.days

To get their value you can do:
  thirdmonth.days.value
Suppose that you created a graph where vertexes month is connected with
the vertexes day by the edge TIMEOF.
Suppose we want to find all the days in the first month and in the third month

Usually we can do in the following way.



However we can obtain the same result with the following command



To get their value you can do:
thirdmonth.days.value
Suppose that you created a graph where vertexes month is connected with the vertexes day by the edge TIMEOF . Suppose we want to find all the days in the first month and in the third month Usually we can do in the following way . However we can obtain the same result with the following command To get their value you can do : thirdmonth . days . value
def add_edge_link name:, direction: :out, edge:
    dir =  direction.to_s == "out" ? :out : :in
    define_method(name.to_sym) do
      return self["#{dir}_#{edge.classname}"].map{|x| x["in"]}
    end
  end
def add_edge_link name : , direction : :out , edge : dir = direction . to_s == "out" ? :out : :in define_method ( name . to_sym ) do return self [ "#{dir}_#{edge.classname}" ] . map { | x | x [ "in" ] } end end
Suppose that you created a graph where vertexes month is connected with
the vertexes day by the edge TIMEOF.
Suppose that you created a graph where vertexes month is connected with the vertexes day by the edge TIMEOF .
name
<not_specific>
direction
<not_specific>
edge
<not_specific>