sy 2.0.9 → 2.0.14.p1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sy/quantity.rb +5 -2
- data/lib/sy/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3e8d0ee8af3d58235251a4ecf4bc5417d0bcf93
|
4
|
+
data.tar.gz: 760db697a01221f8718d1cd3470d970b1e8dc120
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b09ab7db542a71c9f8d45fc67d6cce95fef609d5b6ee3c057342c47207c7d7b51d322d2c23ddffb815faae360ded982c3054fed313e23ea01a8b9b59fffb92f
|
7
|
+
data.tar.gz: 4ee9df2f65f70a09b780f936df629fbf99f54f14786e773382b28e16b5695f3bdcfb936679da4a75215d788ccf946593e9ce4698c1e7db3d7b0e3e1eb45605ce
|
data/lib/sy/quantity.rb
CHANGED
@@ -411,13 +411,14 @@ class SY::Quantity
|
|
411
411
|
mixin = relative? ? SY::SignedMagnitude : SY::AbsoluteMagnitude
|
412
412
|
qnt_ɴ_λ = -> { name ? "#{name}@%s" : "#<Quantity:#{object_id}@%s>" }
|
413
413
|
|
414
|
+
qnt = self
|
414
415
|
@Magnitude = Class.new do
|
415
416
|
include mmod
|
416
417
|
include mixin
|
417
418
|
|
418
419
|
singleton_class.class_exec do
|
419
420
|
define_method :zero do # Costructor of zero magnitudes
|
420
|
-
new amount: 0
|
421
|
+
new amount: 0, of: qnt
|
421
422
|
end
|
422
423
|
|
423
424
|
define_method :to_s do # Customized #to_s. It must be a proc,
|
@@ -449,7 +450,9 @@ class SY::Quantity
|
|
449
450
|
ɴλ.call % "Unit" # as for @Magnitude applies.)
|
450
451
|
end
|
451
452
|
end
|
452
|
-
end.
|
453
|
+
end.tap do |unit_parametrized_subclass|
|
454
|
+
unit_parametrized_subclass.namespace = SY::Unit
|
455
|
+
end
|
453
456
|
end ).tap do |u|
|
454
457
|
puts "@Unit constructed, its namespace is #{u.namespace}" if SY::DEBUG
|
455
458
|
puts "its instances are #{u.namespace.instances}" if SY::DEBUG
|
data/lib/sy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.14.p1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- boris
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-06-
|
11
|
+
date: 2013-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -68,9 +68,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
68
68
|
version: '0'
|
69
69
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
70
|
requirements:
|
71
|
-
- - '
|
71
|
+
- - '>'
|
72
72
|
- !ruby/object:Gem::Version
|
73
|
-
version:
|
73
|
+
version: 1.3.1
|
74
74
|
requirements: []
|
75
75
|
rubyforge_project:
|
76
76
|
rubygems_version: 2.0.3
|