Class: Akane::Storages::AbstractStorage

Inherits:
Object
  • Object
show all
Defined in:
lib/akane/storages/abstract_storage.rb

Direct Known Subclasses

Elasticsearch, File, Mock, Stdout

Instance Method Summary collapse

Constructor Details

#initialize(config: raise(ArgumentError, 'missing config'), logger: Logger.new($stdout)) ⇒ AbstractStorage

Returns a new instance of AbstractStorage.



4
5
6
7
8
# File 'lib/akane/storages/abstract_storage.rb', line 4

def initialize(config: raise(ArgumentError, 'missing config'), logger: Logger.new($stdout))
  @config = config
  @logger = logger
  @stop = false
end

Instance Method Details

#exitable?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/akane/storages/abstract_storage.rb', line 34

def exitable?
  true
end

#mark_as_deleted(account, user_id, tweet_id) ⇒ Object

Raises:

  • (NotImplementedError)


18
19
20
# File 'lib/akane/storages/abstract_storage.rb', line 18

def mark_as_deleted(, user_id, tweet_id)
  raise NotImplementedError
end

#nameObject



10
11
12
# File 'lib/akane/storages/abstract_storage.rb', line 10

def name
  self.class.name
end

#record_event(account, event) ⇒ Object

Raises:

  • (NotImplementedError)


22
23
24
# File 'lib/akane/storages/abstract_storage.rb', line 22

def record_event(, event)
  raise NotImplementedError
end

#record_message(account, message) ⇒ Object

Raises:

  • (NotImplementedError)


26
27
28
# File 'lib/akane/storages/abstract_storage.rb', line 26

def record_message(, message)
  raise NotImplementedError
end

#record_tweet(account, tweet) ⇒ Object

Raises:

  • (NotImplementedError)


14
15
16
# File 'lib/akane/storages/abstract_storage.rb', line 14

def record_tweet(, tweet)
  raise NotImplementedError
end

#statusObject



38
39
40
# File 'lib/akane/storages/abstract_storage.rb', line 38

def status
  nil
end

#stop!Object



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

def stop!
  @stop = true
end