Class: Asset

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/extensions/ezcrypto/ext/test/active_crypto_test.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.create(title, email) ⇒ Object



28
29
30
31
32
33
34
35
36
37
# File 'lib/extensions/ezcrypto/ext/test/active_crypto_test.rb', line 28

def self.create(title,email)
  asset=Asset.new
  asset.set_session_key(EzCrypto::Key.generate)
  asset.title=title
  if asset.save
    asset.share(email)
  else
    nil
  end
end

Instance Method Details

#share(email = nil) ⇒ Object



39
40
41
# File 'lib/extensions/ezcrypto/ext/test/active_crypto_test.rb', line 39

def share(email=nil)
  Cap.create_for_asset(self,email)
end