lib/brightbox-cli/firewall_rules.rb in brightbox-cli-3.3.0 vs lib/brightbox-cli/firewall_rules.rb in brightbox-cli-4.0.0.rc2
- old
+ new
@@ -1,22 +1,22 @@
module Brightbox
class FirewallRules
def self.from_policy(firewall_policy)
rules = firewall_policy.rules
rules.map do |rule|
- fwr = FirewallRule.new('fwr')
+ fwr = FirewallRule.new("fwr")
fwr.attributes = symbolize_keys(rule)
fwr
end
end
- def self.symbolize_keys(object) #:nodoc:
+ 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:
+ 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