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.



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

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



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

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



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

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