Method: Azure::Storage::Common::Service::Serialization::ClassMethods#cors_rule_to_xml

Defined in:
lib/azure/storage/common/service/serialization.rb

#cors_rule_to_xml(cors_rule, xml) ⇒ Object


226
227
228
229
230
231
232
233
234
# File 'lib/azure/storage/common/service/serialization.rb', line 226

def cors_rule_to_xml(cors_rule, xml)
  xml.CorsRule {
    xml.AllowedOrigins cors_rule.allowed_origins.join(",") if cors_rule.allowed_origins
    xml.AllowedMethods cors_rule.allowed_methods.join(",") if cors_rule.allowed_methods
    xml.MaxAgeInSeconds cors_rule.max_age_in_seconds if cors_rule.max_age_in_seconds
    xml.ExposedHeaders cors_rule.exposed_headers.join(",") if cors_rule.exposed_headers
    xml.AllowedHeaders cors_rule.allowed_headers.join(",") if cors_rule.allowed_headers
  }
end