module Stack class Configuration attr_accessor :source, :target attr_accessor :server_port, :server_watch def initialize(hash = nil) self.from_hash(hash) end def from_hash(hash) if (hash != nil) @source = hash[:source] @target = hash[:target] @server_port = hash[:server][:port] @server_watch = hash[:server][:watch] end end def to_hash { :source => self.source, :target => self.target, :server => { :port => self.server_port, :watch => self.server_watch } } end end end