nelson 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nelson/dsl.rb +1 -2
- data/lib/nelson/expression_builder.rb +4 -0
- data/lib/nelson/expression_builders/addition_expression_builder.rb +1 -2
- data/lib/nelson/expression_builders/division_expression_builder.rb +2 -3
- data/lib/nelson/expression_builders/multipication_expression_builder.rb +1 -2
- data/lib/nelson/expression_builders/subtraction_expression_builder.rb +1 -2
- data/lib/nelson/expressions/division_expression.rb +2 -2
- data/lib/nelson/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33aefff26477090c67b8f6cbecfaffd8ac3a3173
|
4
|
+
data.tar.gz: 1623ada73d5b8dcaea957cd320715cebcfd85d95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccb43e9f48aa59421075f7cd27462749a8665f335f5c836d28cbec331ddae08447363bb8f364dd1dc586bee1bc6e37ce5e73f2deff522f22fb5b69fae1acf044
|
7
|
+
data.tar.gz: aca694d340d8c234715a67b336f5d8f1c07238f7d4c1daabd60b96ddd116c104d6a58dd755ab5d47c48df12103a805e8196a21f7a34e2a99e75339cd754933ae
|
data/lib/nelson/dsl.rb
CHANGED
@@ -28,6 +28,10 @@ module Nelson
|
|
28
28
|
def divided_by(term)
|
29
29
|
DivisionExpressionBuilder.new(self, term)
|
30
30
|
end
|
31
|
+
|
32
|
+
def built_terms
|
33
|
+
terms.map { |e| e.is_a?(ExpressionBuilder) ? e.build : e }
|
34
|
+
end
|
31
35
|
end
|
32
36
|
|
33
37
|
autoload :MultipicationExpressionBuilder, "nelson/expression_builders/multipication_expression_builder"
|
@@ -2,11 +2,11 @@
|
|
2
2
|
module Nelson
|
3
3
|
class DivisionExpression < Expression
|
4
4
|
def initialize(term1, term2)
|
5
|
-
super(term1
|
5
|
+
super(term1, term2)
|
6
6
|
end
|
7
7
|
|
8
8
|
def call
|
9
|
-
terms.reduce(:/)
|
9
|
+
terms.map { |n| n.is_a?(Numeric) ? n.to_f : n }.reduce(:/)
|
10
10
|
end
|
11
11
|
|
12
12
|
def to_s
|
data/lib/nelson/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nelson
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrick Metcalfe
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|