lib/adyen/form.rb in adyen-0.2.2 vs lib/adyen/form.rb in adyen-0.2.3
- old
+ new
@@ -11,15 +11,22 @@
def self.skins
@skins ||= {}
end
+ def self.skins=(hash)
+ @skins = hash.inject({}) do |skins, (name, skin)|
+ skins[name.to_sym] = skin.merge(:name => name.to_sym)
+ skins
+ end
+ end
+
def self.register_skin(name, skin_code, shared_secret)
- self.skins[name] = {:name => name, :skin_code => skin_code, :shared_secret => shared_secret }
+ self.skins[name.to_sym] = {:name => name.to_sym, :skin_code => skin_code, :shared_secret => shared_secret }
end
def self.skin_by_name(skin_name)
- self.skins[skin_name]
+ self.skins[skin_name.to_sym]
end
def self.skin_by_code(skin_code)
self.skins.detect { |(name, skin)| skin[:skin_code] == skin_code }.last rescue nil
end
\ No newline at end of file