Class: DaimonSkycrawlers::Storage::Base

Inherits:
Object
  • Object
show all
Includes:
ConfigMixin, LoggerMixin
Defined in:
lib/daimon_skycrawlers/storage/base.rb

Overview

Base class of storage implementation

Direct Known Subclasses

File, Null, RDB

Instance Method Summary collapse

Instance Method Details

#read(message = {}) ⇒ Object

Fetch page identified by url

Override this method in subclass

Parameters:

  • message (Hash) (defaults to: {})

    this hash can include :url, :key to find page



34
35
36
# File 'lib/daimon_skycrawlers/storage/base.rb', line 34

def read(message = {})
  raise "Implement this in subclass"
end

#save(data) ⇒ Object

Save data to storage

Override this method in subclass

Parameters:

  • data (Hash)

    data has following keys

    • :url: URL
    • :message: Given message
    • :response: HTTP response


23
24
25
# File 'lib/daimon_skycrawlers/storage/base.rb', line 23

def save(data)
  raise "Implement this in subclass"
end