lib/grom/node.rb in grom-0.3.4 vs lib/grom/node.rb in grom-0.3.5

- old
+ new

@@ -3,11 +3,10 @@ attr_reader :statements def initialize(statements) @statements = statements - set_id populate end def method_missing(method, *params, &block) instance_variable_get("@#{method}".to_sym) || super @@ -17,15 +16,16 @@ instance_variable_get("@#{method}".to_sym) || super end private - def set_id - id = Grom::Helper.get_id(@statements.first.subject) - instance_variable_set('@id'.to_sym, id) + def set_graph_id + graph_id = Grom::Helper.get_id(@statements.first.subject) + instance_variable_set('@graph_id'.to_sym, graph_id) end def populate + set_graph_id @statements.each do |statement| attribute_name = Grom::Helper.get_id(statement.predicate) attribute_value = statement.object.to_s instance_variable_set("@#{attribute_name}".to_sym, attribute_value) end