Class: Urbit::Fact::AddNodesFact

Inherits:
GraphUpdateFact show all
Defined in:
lib/urbit/fact/graph_fact.rb

Instance Attribute Summary

Attributes inherited from BaseFact

#ack, #channel, #data, #type

Instance Method Summary collapse

Methods inherited from GraphUpdateFact

#attach_parser, #graph_update?, #incoming_graph, #resource, #resource_h, #root_h, #to_h

Methods inherited from BaseFact

#add_ack, #contents, #for_this_ship?, #graph_update?, #is_acknowledged?, #ship, #to_h, #to_s

Constructor Details

#initialize(channel:, event:) ⇒ AddNodesFact

Returns a new instance of AddNodesFact.



59
60
61
# File 'lib/urbit/fact/graph_fact.rb', line 59

def initialize(channel:, event:)
  super channel: channel, event: event
end

Instance Method Details

#create_parserObject



63
64
65
# File 'lib/urbit/fact/graph_fact.rb', line 63

def create_parser
  Urbit::AddNodesParser.new(for_graph: self.incoming_graph,  with_json: self.raw_json).add_nodes
end

#raw_jsonObject



67
68
69
# File 'lib/urbit/fact/graph_fact.rb', line 67

def raw_json
  self.root_h["add-nodes"]
end