Class: Inkfilepicker::Policy
- Inherits:
-
Object
- Object
- Inkfilepicker::Policy
- Defined in:
- lib/inkfilepicker/policy.rb
Instance Attribute Summary collapse
-
#call ⇒ Object
Returns the value of attribute call.
-
#expiry ⇒ Object
Returns the value of attribute expiry.
-
#handle ⇒ Object
Returns the value of attribute handle.
-
#maxsize ⇒ Object
Returns the value of attribute maxsize.
-
#minsize ⇒ Object
Returns the value of attribute minsize.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Policy
constructor
A new instance of Policy.
- #policy ⇒ Object
- #signature ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Policy
Returns a new instance of Policy.
8 9 10 11 12 |
# File 'lib/inkfilepicker/policy.rb', line 8 def initialize( = {}) [:expiry, :call, :handle, :maxsize, :minsize, :path].each do |input| send("#{input}=", [input]) unless [input].nil? end end |
Instance Attribute Details
#call ⇒ Object
Returns the value of attribute call.
6 7 8 |
# File 'lib/inkfilepicker/policy.rb', line 6 def call @call end |
#expiry ⇒ Object
Returns the value of attribute expiry.
6 7 8 |
# File 'lib/inkfilepicker/policy.rb', line 6 def expiry @expiry end |
#handle ⇒ Object
Returns the value of attribute handle.
6 7 8 |
# File 'lib/inkfilepicker/policy.rb', line 6 def handle @handle end |
#maxsize ⇒ Object
Returns the value of attribute maxsize.
6 7 8 |
# File 'lib/inkfilepicker/policy.rb', line 6 def maxsize @maxsize end |
#minsize ⇒ Object
Returns the value of attribute minsize.
6 7 8 |
# File 'lib/inkfilepicker/policy.rb', line 6 def minsize @minsize end |
#path ⇒ Object
Returns the value of attribute path.
6 7 8 |
# File 'lib/inkfilepicker/policy.rb', line 6 def path @path end |
Instance Method Details
#policy ⇒ Object
14 15 16 |
# File 'lib/inkfilepicker/policy.rb', line 14 def policy Base64.urlsafe_encode64(json_policy) end |
#signature ⇒ Object
18 19 20 |
# File 'lib/inkfilepicker/policy.rb', line 18 def signature OpenSSL::HMAC.hexdigest('sha256', Inkfilepicker.secret_key, policy) end |