Class: BlueFactory::Interaction
- Inherits:
-
Object
- Object
- BlueFactory::Interaction
- 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
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#event ⇒ Object
readonly
Returns the value of attribute event.
-
#item ⇒ Object
readonly
Returns the value of attribute item.
-
#req_id ⇒ Object
readonly
Returns the value of attribute req_id.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(data) ⇒ Interaction
constructor
A new instance of Interaction.
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
#context ⇒ Object (readonly)
Returns the value of attribute context.
13 14 15 |
# File 'lib/blue_factory/interaction.rb', line 13 def context @context end |
#event ⇒ Object (readonly)
Returns the value of attribute event.
13 14 15 |
# File 'lib/blue_factory/interaction.rb', line 13 def event @event end |
#item ⇒ Object (readonly)
Returns the value of attribute item.
13 14 15 |
# File 'lib/blue_factory/interaction.rb', line 13 def item @item end |
#req_id ⇒ Object (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 |
#type ⇒ Object (readonly)
Returns the value of attribute type.
13 14 15 |
# File 'lib/blue_factory/interaction.rb', line 13 def type @type end |