Class: NameSpotter::Client

Inherits:
Object show all
Defined in:
lib/name-spotter/client.rb

Direct Known Subclasses

NetiNetiClient, TaxonFinderClient

Defined Under Namespace

Classes: ClientError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ Client

Returns a new instance of Client.



8
9
10
11
12
# File 'lib/name-spotter/client.rb', line 8

def initialize(opts)
  @host = opts[:host]
  @port = opts[:port]
  @names = []
end

Instance Attribute Details

#hostObject (readonly)

Returns the value of attribute host.



5
6
7
# File 'lib/name-spotter/client.rb', line 5

def host
  @host
end

#portObject (readonly)

Returns the value of attribute port.



6
7
8
# File 'lib/name-spotter/client.rb', line 6

def port
  @port
end

Instance Method Details

#add_name(name) ⇒ Object



18
19
20
# File 'lib/name-spotter/client.rb', line 18

def add_name(name)
  @names << name
end

#find(text) ⇒ Object



14
15
16
# File 'lib/name-spotter/client.rb', line 14

def find(text)
  raise "Subclass must implement find"
end