Class: FakeSNS::MemoryStorage

Inherits:
Storage
  • Object
show all
Defined in:
lib/fake_sns/storage.rb

Instance Method Summary collapse

Methods inherited from Storage

#[], #[]=, for, #initialize

Constructor Details

This class inherits a constructor from FakeSNS::Storage

Instance Method Details

#replace(data) ⇒ Object



44
45
46
# File 'lib/fake_sns/storage.rb', line 44

def replace(data)
  @storage = YAML.load(data)
end

#storageObject



36
37
38
# File 'lib/fake_sns/storage.rb', line 36

def storage
  @storage ||= {}
end

#to_yamlObject



31
32
33
# File 'lib/fake_sns/storage.rb', line 31

def to_yaml
  storage.to_yaml
end

#transactionObject



40
41
42
# File 'lib/fake_sns/storage.rb', line 40

def transaction
  yield
end