Class: Mock_Zoonar

Inherits:
Object
  • Object
show all
Defined in:
lib/multistockphoto/mock_zoonar.rb

Instance Method Summary collapse

Constructor Details

#initialize(key, *args) ⇒ Mock_Zoonar

Returns a new instance of Mock_Zoonar.



2
3
4
5
6
7
8
# File 'lib/multistockphoto/mock_zoonar.rb', line 2

def initialize(key,*args)
  @key = key
  
  if args[0].include? :remaining
    @remaining = args[0][:remaining]
      end
end

Instance Method Details

#transfer(photo) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/multistockphoto/mock_zoonar.rb', line 10

def transfer(photo)
  if @remaining < 1
    raise UploadException
  end
  @remaining -= 1
  true
end