Class: Urbit::Fact::AddGroupFact
- Inherits:
-
GroupUpdateFact
- Object
- BaseFact
- GroupUpdateFact
- Urbit::Fact::AddGroupFact
- Defined in:
- lib/urbit/fact/group_fact.rb
Instance Attribute Summary
Attributes inherited from BaseFact
Instance Method Summary collapse
-
#initialize(channel:, event:) ⇒ AddGroupFact
constructor
A new instance of AddGroupFact.
- #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:) ⇒ AddGroupFact
Returns a new instance of AddGroupFact.
19 20 21 22 |
# File 'lib/urbit/fact/group_fact.rb', line 19 def initialize(channel:, event:) super channel: channel, event: event self.channel.ship.groups.add(self.parser.group) end |
Instance Method Details
#parser ⇒ Object
24 25 26 |
# File 'lib/urbit/fact/group_fact.rb', line 24 def parser Urbit::AddGroupParser.new(with_json: self.raw_json) end |
#raw_json ⇒ Object
28 29 30 |
# File 'lib/urbit/fact/group_fact.rb', line 28 def raw_json self.root_h["addGroup"] end |