Class: YDIM::Html::Util::Server

Inherits:
SBSM::DRbServer
  • Object
show all
Defined in:
lib/ydim/html/util/server.rb

Constant Summary collapse

SESSION =
Html::Util::Session
VALIDATOR =
Html::Util::Validator

Instance Method Summary collapse

Constructor Details

#initialize(server) ⇒ Server

Returns a new instance of Server.



16
17
18
19
20
21
# File 'lib/ydim/html/util/server.rb', line 16

def initialize(server)
	@server = server
	@private_key = OpenSSL::PKey::DSA.new(File.read(Html.config.root_key))
	@system = YDIM::Client.new(Html.config)
	super(@system)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args) ⇒ Object



25
26
27
28
29
30
31
32
# File 'lib/ydim/html/util/server.rb', line 25

def method_missing(meth, *args)
	@system.(@server, @private_key)
	begin
		@system.send(meth, *args)
	ensure
		@system.logout
	end
end

Instance Method Details

#login(email, pass_hash) ⇒ Object



22
23
24
# File 'lib/ydim/html/util/server.rb', line 22

def (email, pass_hash)
	(email == Html.config.email) && (pass_hash == Html.config.md5_pass)
end