Class: BlueFactory::Interaction

Inherits:
Object
  • Object
show all
Defined in:
lib/blue_factory/interaction.rb

Constant Summary collapse

EVENTS =
{
  'app.bsky.feed.defs#interactionLike' => :like,
  'app.bsky.feed.defs#interactionQuote' => :quote,
  'app.bsky.feed.defs#interactionReply' => :reply,
  'app.bsky.feed.defs#interactionRepost' => :repost,
  'app.bsky.feed.defs#interactionSeen' => :seen,
  'app.bsky.feed.defs#requestLess' => :request_less,
  'app.bsky.feed.defs#requestMore' => :request_more
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Interaction



15
16
17
18
19
20
21
# File 'lib/blue_factory/interaction.rb', line 15

def initialize(data)
  @item = data['item']
  @event = data['event']
  @context = data['feedContext']
  @req_id = data['reqId']
  @type = EVENTS[@event]
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



13
14
15
# File 'lib/blue_factory/interaction.rb', line 13

def context
  @context
end

#eventObject (readonly)

Returns the value of attribute event.



13
14
15
# File 'lib/blue_factory/interaction.rb', line 13

def event
  @event
end

#itemObject (readonly)

Returns the value of attribute item.



13
14
15
# File 'lib/blue_factory/interaction.rb', line 13

def item
  @item
end

#req_idObject (readonly)

Returns the value of attribute req_id.



13
14
15
# File 'lib/blue_factory/interaction.rb', line 13

def req_id
  @req_id
end

#typeObject (readonly)

Returns the value of attribute type.



13
14
15
# File 'lib/blue_factory/interaction.rb', line 13

def type
  @type
end