Module: Buby::Implants::Cookie
- Defined in:
- lib/buby/implants/cookie.rb
Overview
Note:
This module is used to extend the ICookie interface implementation java class at runtime.
This interface is used to hold details about an HTTP cookie.
Class Method Summary collapse
-
.implant(cookie) ⇒ Object
Install ourselves into the current
ICookie
java class.
Instance Method Summary collapse
-
#getExpiration ⇒ Time
This method is used to retrieve the expiration time for the cookie.
Class Method Details
.implant(cookie) ⇒ Object
Install ourselves into the current ICookie
java class
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/buby/implants/cookie.rb', line 21 def self.implant() unless .implanted? || .nil? pp [:implanting, , .class] if $DEBUG .class.class_exec() do || a_methods = %w{ getExpiration } a_methods.each do |meth| pp ["__" + meth, self] if $DEBUG alias_method "__"+meth.to_s, meth end include Buby::Implants::Cookie a_methods.each do |meth| pp [meth, self] if $DEBUG java_class.ruby_names_for_java_method(meth).each do |ruby_meth| pp [ruby_meth, meth, self] if $DEBUG define_method ruby_meth, Buby::Implants::Cookie.instance_method(meth) end end include Buby::Implants::Proxy end end end |
Instance Method Details
#getExpiration ⇒ Time
This method is used to retrieve the expiration time for the cookie.
13 14 15 16 |
# File 'lib/buby/implants/cookie.rb', line 13 def getExpiration ret = __getExpiration ret.nil? ? ret : Time.at(ret.time/1000.0) end |