Browse files

Lizard.new can set attributes on the generated object

  • Loading branch information...
1 parent ae5d2c7 commit e35efebd778cc178dad91c3036f02ec5d659a28a @telent committed Apr 3, 2012
Showing with 8 additions and 6 deletions.
  1. +8 −4 lib/lizard.rb
  2. +0 −2 lib/lizard/filesystem.rb
View
12 lib/lizard.rb
@@ -58,11 +58,15 @@ def receive_data data
end
end
- def initialize
+ attr_accessor :command_socket,:syslog_server
+ def initialize(attr={})
@monitors={}
- end
- def command_socket
- "/tmp/lizard.sock"
+ {
+ command_socket: "/tmp/lizard.sock",
+ syslog_server: "localhost:5514"
+ }.merge(attr).each{|k,v|
+ s="#{k}=".to_sym; if self.respond_to?(s) then self.send(s,v) end
+ }
end
def add clss,name,&blk
View
2 lib/lizard/filesystem.rb
@@ -5,5 +5,3 @@ class Lizard::Filesystem < Lizard::Monitor
end
end
end
-
-

0 comments on commit e35efeb

Please sign in to comment.