Class: Nerve::Easy::Reporter

Inherits:
Object
  • Object
show all
Includes:
Fake::Hash, FixedInstanceId
Defined in:
lib/nerve/easy/reporter.rb

Direct Known Subclasses

Service

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from FixedInstanceId

#instance_id, instance_id

Constructor Details

#initialize(params = {}) ⇒ Reporter

Returns a new instance of Reporter.



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/nerve/easy/reporter.rb', line 10

def initialize params={}
  @zk_hosts   = params[:zk_hosts]
  @zk_hosts ||= [ "localhost:2181" ]
  @zk_path    = params[:zh_path]
  @zk_path  ||= "/doorkeepr/entrance"
  @host       = params[:host]
  @host     ||= "localhost"
  @port       = params[:port]
  @port     ||= 3000
  @name     ||= "publisher"
end

Instance Attribute Details

#host ⇒ Object

Returns the value of attribute host.



9
10
11
# File 'lib/nerve/easy/reporter.rb', line 9

def host
  @host
end

#name ⇒ Object

Returns the value of attribute name.



9
10
11
# File 'lib/nerve/easy/reporter.rb', line 9

def name
  @name
end

#port ⇒ Object

Returns the value of attribute port.



9
10
11
# File 'lib/nerve/easy/reporter.rb', line 9

def port
  @port
end

#zk_hosts ⇒ Object

Returns the value of attribute zk_hosts.



9
10
11
# File 'lib/nerve/easy/reporter.rb', line 9

def zk_hosts
  @zk_hosts
end

#zk_path ⇒ Object

Returns the value of attribute zk_path.



9
10
11
# File 'lib/nerve/easy/reporter.rb', line 9

def zk_path
  @zk_path
end

Instance Method Details

#to_nerve ⇒ Object



21
22
23
24
25
26
27
28
29
# File 'lib/nerve/easy/reporter.rb', line 21

def to_nerve
  {
    "zk_hosts"    => zk_hosts,
    "zk_path"     => zk_path,
    "instance_id" => instance_id,
    "host"        => host,
    "port"        => port
  }
end