Class: MockProgress

Inherits:
Object
  • Object
show all
Defined in:
lib/upload_progress/test/upload_progress_helper_testx.rb

Instance Method Summary collapse

Constructor Details

#initialize(started, finished) ⇒ MockProgress

Returns a new instance of MockProgress.



11
12
13
# File 'lib/upload_progress/test/upload_progress_helper_testx.rb', line 11

def initialize(started, finished)
  @started, @finished = [started, finished]
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args) ⇒ Object



27
28
29
30
# File 'lib/upload_progress/test/upload_progress_helper_testx.rb', line 27

def method_missing(meth, *args)
  # Just return some consitant number
  meth.to_s.hash.to_i.abs + args.hash.to_i.abs
end

Instance Method Details

#finished?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/upload_progress/test/upload_progress_helper_testx.rb', line 19

def finished?
  @finished
end

#messageObject



23
24
25
# File 'lib/upload_progress/test/upload_progress_helper_testx.rb', line 23

def message
  "A message"
end

#started?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/upload_progress/test/upload_progress_helper_testx.rb', line 15

def started?
  @started
end