Class: Akane::Storages::Mock

Inherits:
AbstractStorage show all
Defined in:
lib/akane/storages/mock.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractStorage

#exitable?, #initialize, #name, #status, #stop!

Constructor Details

This class inherits a constructor from Akane::Storages::AbstractStorage

Class Method Details

.deletion_marksObject



11
12
13
# File 'lib/akane/storages/mock.rb', line 11

def deletion_marks
  @deletion_marks ||= []
end

.recorded_eventsObject



15
16
17
# File 'lib/akane/storages/mock.rb', line 15

def recorded_events
  @recorded_events ||= []
end

.recorded_messagesObject



19
20
21
# File 'lib/akane/storages/mock.rb', line 19

def recorded_messages
  @recorded_messages ||= []
end

.recorded_tweetsObject



7
8
9
# File 'lib/akane/storages/mock.rb', line 7

def recorded_tweets
  @recorded_tweets ||= []
end

.reset!Object



23
24
25
26
27
# File 'lib/akane/storages/mock.rb', line 23

def reset!
  [recorded_tweets, deletion_marks,
    recorded_events, recorded_messages].each(&:clear)
  self
end

Instance Method Details

#mark_as_deleted(account, user_id, tweet_id) ⇒ Object



35
36
37
38
# File 'lib/akane/storages/mock.rb', line 35

def mark_as_deleted(, user_id, tweet_id)
  self.class.deletion_marks << [, user_id, tweet_id]
  self
end

#record_event(account, event) ⇒ Object



40
41
42
43
# File 'lib/akane/storages/mock.rb', line 40

def record_event(, event)
  self.class.recorded_events << [, event]
  self
end

#record_message(account, message) ⇒ Object



45
46
47
48
# File 'lib/akane/storages/mock.rb', line 45

def record_message(, message)
  self.class.recorded_messages << [, message]
  self
end

#record_tweet(account, tweet) ⇒ Object



30
31
32
33
# File 'lib/akane/storages/mock.rb', line 30

def record_tweet(, tweet)
  self.class.recorded_tweets << [, tweet]
  self
end