Class: YadisServiceManager

Inherits:
Object
  • Object
show all
Defined in:
lib/yadis/manager.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(starting_url, yadis_url, services) ⇒ YadisServiceManager

Returns a new instance of YadisServiceManager.



7
8
9
10
11
12
# File 'lib/yadis/manager.rb', line 7

def initialize(starting_url, yadis_url, services)
  @starting_url = starting_url
  @yadis_url = yadis_url
  @services = services
  @current = nil
end

Instance Attribute Details

#currentObject (readonly)

Returns the value of attribute current.



5
6
7
# File 'lib/yadis/manager.rb', line 5

def current
  @current
end

#servicesObject (readonly)

Returns the value of attribute services.



5
6
7
# File 'lib/yadis/manager.rb', line 5

def services
  @services
end

#session_keyObject (readonly)

Returns the value of attribute session_key.



5
6
7
# File 'lib/yadis/manager.rb', line 5

def session_key
  @session_key
end

#starting_urlObject (readonly)

Returns the value of attribute starting_url.



5
6
7
# File 'lib/yadis/manager.rb', line 5

def starting_url
  @starting_url
end

#yadis_urlObject (readonly)

Returns the value of attribute yadis_url.



5
6
7
# File 'lib/yadis/manager.rb', line 5

def yadis_url
  @yadis_url
end

Instance Method Details

#for_url?(url) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/yadis/manager.rb', line 18

def for_url?(url)
  url == @starting_url or url == @yadis_url
end

#lengthObject



26
27
28
# File 'lib/yadis/manager.rb', line 26

def length
  @services.length
end

#nextObject



14
15
16
# File 'lib/yadis/manager.rb', line 14

def next
  @current = @services.shift
end

#started?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/yadis/manager.rb', line 22

def started?
  not @current.nil?
end