lib/ccrypto/key_bundle.rb in ccrypto-0.1.3 vs lib/ccrypto/key_bundle.rb in ccrypto-0.2.0
- old
+ new
@@ -1,12 +1,31 @@
module Ccrypto
module KeyBundle
- attr_accessor :nativeKeypair
+ attr_reader :nativeKeypair
def KeyBundle.from_storage(*args, &block)
Provider.instance.provider.keybundle_from_storage(*args, &block)
+ end
+
+ def native
+ @nativeKeypair
+ end
+ alias_method :keypair, :native
+
+ private
+ def method_missing(mtd, *args, &block)
+ if not @nativeKeypair.nil?
+ logger.debug "Sending to method #{mtd} of object '#{@nativeKeypair}' at KeyBundle level"
+ @nativeKeypair.send(mtd, *args, &block)
+ else
+ super
+ end
+ end
+
+ def logger
+ Ccrypto.logger(:keybundle)
end
end
module ECCKeyBundle