ruby-zoom 3.1.3 → 3.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/zoom.rb +1 -1
  3. data/lib/zoom/profile.rb +7 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 51adcd06f3b2b5bc2ad0a6a9bda4d9ca1205acb6
4
- data.tar.gz: 73ae05dccdd47c31c3238cb7ff67f11abdbe8324
3
+ metadata.gz: 3dcc3f7e09fe05c3ef29bf55a947d48ab6d0d1be
4
+ data.tar.gz: 3cb6fd45e77af7d96c54f75f9452a1b57789dbac
5
5
  SHA512:
6
- metadata.gz: b3aa31a670370e60044208c3f7a7cc10042e3d56537d0d1d4f2b06c9f6561088bbc08794056532499b48563147a450ba6e563d1c3c962f95da0a1653e5a9def4
7
- data.tar.gz: b5fb7cec38a9ae23f8050826ed6fc82243abea81babc82b8a063b0ed1473026fcac177d570a1f74cf202b0389b23420333d6e55c29e6fb1d80b67756d63af10f
6
+ metadata.gz: 266f3791b25e3b4728b37442359ec7187bc256c1d786ae5ef7080dc880648d4dcde929ba05206edbf7af49a3f34a1414f11462e9c11bc9723ec1d0f922661a02
7
+ data.tar.gz: e0d36866de0ecb6245e96d22fae3e637685b9e972bfbf7e0fa5b5f66fb0b97af374ee00ee6dd5cb8bdb82b3b82a859081e700440ea74d803979c941df44477ff
@@ -26,7 +26,7 @@ class Zoom
26
26
 
27
27
  default_class = nil
28
28
  begin
29
- default_class = Object::const_get(clas).new
29
+ default_class = Zoom::Profile.profile_by_name(clas).new
30
30
  rescue NameError => e
31
31
  raise Zoom::ProfileClassUnknownError.new(clas)
32
32
  end
@@ -27,7 +27,7 @@ class Zoom::Profile < Hash
27
27
 
28
28
  def self.from_json(json)
29
29
  begin
30
- return Object::const_get(json["class"]).new(
30
+ return profile_by_name(json["class"]).new(
31
31
  json["operator"].nil? ? "" : json["operator"],
32
32
  json["flags"].nil? ? "" : json["flags"],
33
33
  json["prepend"].nil? ? "" : json["prepend"],
@@ -87,6 +87,12 @@ class Zoom::Profile < Hash
87
87
  return self["prepend"]
88
88
  end
89
89
 
90
+ def self.profile_by_name(clas)
91
+ clas.split("::").inject(Object) do |mod, class_name|
92
+ mod.const_get(class_name)
93
+ end
94
+ end
95
+
90
96
  def to_s
91
97
  [
92
98
  self.colors,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-zoom
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.3
4
+ version: 3.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Whittaker