Class: Urbit::Fact::AddGraphFact
- Inherits:
-
GraphUpdateFact
- Object
- BaseFact
- GraphUpdateFact
- Urbit::Fact::AddGraphFact
- Defined in:
- lib/urbit/fact/graph_fact.rb
Instance Attribute Summary
Attributes inherited from BaseFact
Instance Method Summary collapse
- #create_parser ⇒ Object
-
#initialize(channel:, event:) ⇒ AddGraphFact
constructor
A new instance of AddGraphFact.
- #raw_json ⇒ Object
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:) ⇒ AddGraphFact
Returns a new instance of AddGraphFact.
45 46 47 |
# File 'lib/urbit/fact/graph_fact.rb', line 45 def initialize(channel:, event:) super channel: channel, event: event end |
Instance Method Details
#create_parser ⇒ Object
49 50 51 |
# File 'lib/urbit/fact/graph_fact.rb', line 49 def create_parser Urbit::AddGraphParser.new(for_graph: self.incoming_graph, with_json: self.raw_json).add_nodes end |
#raw_json ⇒ Object
53 54 55 |
# File 'lib/urbit/fact/graph_fact.rb', line 53 def raw_json self.root_h["add-graph"] end |