diff options
author | Markus Reiter <me@reitermark.us> | 2017-05-06 20:45:12 +0200 |
---|---|---|
committer | Markus Reiter <me@reitermark.us> | 2017-05-06 21:45:24 +0200 |
commit | cc2b6f24436439ddffda62d9c85d295da1316d18 (patch) | |
tree | 3975e7642ff1ba84a3ffff75689e43f09390241f | |
parent | 09248f031df32eec34ae4fcf46abff0154cc850f (diff) | |
download | plist-cc2b6f24436439ddffda62d9c85d295da1316d18.tar.gz |
Don’t use class variables.
-rwxr-xr-x | lib/plist/parser.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/plist/parser.rb b/lib/plist/parser.rb index 705d823..4835f8b 100755 --- a/lib/plist/parser.rb +++ b/lib/plist/parser.rb @@ -130,10 +130,8 @@ module Plist end class PTag - @@mappings = {} - def self.mappings - @@mappings + @mappings ||= {} end def self.inherited(sub_class) @@ -141,7 +139,7 @@ module Plist key.gsub!(/^plist::/, '') key.gsub!(/^p/, '') unless key == "plist" - @@mappings[key] = sub_class + mappings[key] = sub_class end attr_accessor :text, :children |