class Azure::SAS::Options
Holds all possible options for a SAS
generation
Constants
- FIELDS
Public Instance Methods
to_query_values()
click to toggle source
# File lib/azure/sas/options.rb, line 26 def to_query_values { signedresource: signedresource, signedstart: signedstart && signedstart.utc.iso8601, signedexpiry: signedexpiry && signedexpiry.utc.iso8601, signedpermissions: signedpermissions, identifier: identifier }.map do |key, value| [FIELDS.fetch(key), value] if value end.compact.to_h end
validate!()
click to toggle source
# File lib/azure/sas/options.rb, line 15 def validate! validate_option_value( :signedresource, signedresource, BLOB_RESOURCE, CONTAINER_RESOURCE, nil ) validate_option_type(:signedstart, signedstart, Time) validate_option_type(:signedexpiry, signedstart, Time) end
Private Instance Methods
validate_option_type(name, val, type)
click to toggle source
# File lib/azure/sas/options.rb, line 40 def validate_option_type(name, val, type) unless val.is_a?(type) raise WrongOptionsError, "#{name.inspect} should be of type #{type}" end end
validate_option_value(name, val, *allowed)
click to toggle source
# File lib/azure/sas/options.rb, line 47 def validate_option_value(name, val, *allowed) raise WrongOptionsError, "#{val.inspect} is not allowed value for #{name.inspect}"\ " (Allowed: #{allowed.map(&:inspect).join(', ')}" end