Sha256: 08738d011d774a443f90ddc5fd96091ea3ed2c9c1d5cdabc8d1bb35a575f4acf
Contents?: true
Size: 611 Bytes
Versions: 17
Compression:
Stored size: 611 Bytes
Contents
module Brightbox class FirewallRules def self.from_policy(firewall_policy) rules = firewall_policy.rules rules.map do |rule| fwr = FirewallRule.new("fwr") fwr.attributes = symbolize_keys(rule) fwr end end def self.symbolize_keys(object) # :nodoc: modify_keys(object) do |key| key.is_a?(String) ? key.to_sym : key end end def self.modify_keys(object, &modifier) # :nodoc: object.reduce({}) do |result, (key, value)| new_key = modifier.call(key) result.merge! new_key => value end end end end
Version data entries
17 entries across 17 versions & 1 rubygems