Class: Urbit::Fact::InitialGroupFact
- Inherits:
-
GroupUpdateFact
- Object
- BaseFact
- GroupUpdateFact
- Urbit::Fact::InitialGroupFact
- Defined in:
- lib/urbit/fact/group_fact.rb
Instance Attribute Summary
Attributes inherited from BaseFact
Instance Method Summary collapse
-
#initialize(channel:, event:) ⇒ InitialGroupFact
constructor
A new instance of InitialGroupFact.
- #parser ⇒ Object
- #raw_json ⇒ Object
Methods inherited from GroupUpdateFact
Methods inherited from BaseFact
#add_ack, #contents, #create_parser, #for_this_ship?, #graph_update?, #is_acknowledged?, #ship, #to_h, #to_s
Constructor Details
#initialize(channel:, event:) ⇒ InitialGroupFact
Returns a new instance of InitialGroupFact.
64 65 66 67 |
# File 'lib/urbit/fact/group_fact.rb', line 64 def initialize(channel:, event:) super channel: channel, event: event self.parser.groups.each {|g| self.channel.ship.groups.add(g)} end |
Instance Method Details
#parser ⇒ Object
69 70 71 |
# File 'lib/urbit/fact/group_fact.rb', line 69 def parser Urbit::InitialGroupParser.new(with_json: self.raw_json) end |
#raw_json ⇒ Object
73 74 75 |
# File 'lib/urbit/fact/group_fact.rb', line 73 def raw_json self.root_h["initial"] end |