Class: Flickr::Test

Inherits:
Object show all
Defined in:
lib/flickr/test.rb

Instance Method Summary collapse

Constructor Details

#initialize(flickr) ⇒ Test

Returns a new instance of Test.



2
3
4
# File 'lib/flickr/test.rb', line 2

def initialize(flickr)
  @flickr = flickr
end

Instance Method Details

#echo(options = {}) ⇒ Object

A testing method which echo’s all parameters back in the response.

pass any number of options as a hash and it will be returned



17
18
19
20
21
# File 'lib/flickr/test.rb', line 17

def echo(options = {})
  rsp = @flickr.send_request('flickr.test.echo', options)
  
  options
end

#loginObject

A testing method which checks if the caller is logged in then returns their username.



8
9
10
11
# File 'lib/flickr/test.rb', line 8

def 
  rsp = @flickr.send_request('flickr.test.login')
  rsp.user.username.to_s
end

#nullObject

Null test

Returns true unless there is an error



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

def null
   rsp = @flickr.send_request('flickr.test.null')
   true
end