Class: Srvy::Formatters::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/srvy/formatters/base.rb

Direct Known Subclasses

Dalli, HostPort

Instance Method Summary collapse

Instance Method Details

#format_many(hosts) ⇒ Object



9
10
11
12
13
14
# File 'lib/srvy/formatters/base.rb', line 9

def format_many(hosts)
  # default to mapping over the collection with the format_single form
  # by having a separate format_many call, we can build formatters
  # that aggregate results in some way (such as producing a map of the hosts)
  hosts.map{|h| format_single h}
end

#format_single(host) ⇒ Object

Raises:

  • (NotImplementedError)


5
6
7
# File 'lib/srvy/formatters/base.rb', line 5

def format_single(host)
  raise NotImplementedError
end