ruby-mext 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 40f5f1b9e36396a37015c8e39277bd65bd0bfcfe9d36dfe3332a46be9de7a346
4
- data.tar.gz: bf3d5e183f2dafca96f403b0e17f1c90152a114a0139a106c8df11dd69879046
3
+ metadata.gz: 89c134d002e5da2d18b28325bd3153d4f3aea0f67a362152b32a984607016538
4
+ data.tar.gz: 9b9c21280afa82c51ef4c6f30e8cf82396826b38a617cf7c731f2b1c958e79a1
5
5
  SHA512:
6
- metadata.gz: a0facd96e882b21e76d46dc738cc84136714c3f9a8bf207ec2244746ccac4e5fd39bf732e7794f983a918ec1602bb89dfb6b800dc712f932b9816338460e576a
7
- data.tar.gz: f950ccf2c1840526a8d9f5dc4e5045e8ae8b8e409664c4fada704db959bcc0f4932fad205f157c0982f31267ee616541df1f47bbabeee8713222b9ed6e6d5984
6
+ metadata.gz: 7e3ed69e38787efd0320ede22d4c3e3cbfe912ea29dd5e042216e8880baf88fa02d2a5d4b2fdb67150bdf884dec42564f7b0be68cc1abcc90d51cf3a98d57f46
7
+ data.tar.gz: 4d4c512bebbd0494db0546554f6b0a7dc006b747835b2b6dcee087894fc5d2d754e95885a5c95bc534575531d930cab2c8763c81ad03623eaab437c1c0f9e96f
@@ -51,6 +51,27 @@ module Math
51
51
  "tau: #{self.tau}"
52
52
  end
53
53
 
54
+ class << self
55
+
56
+ #
57
+ # +from_yaml(yaml_hash)+:
58
+ #
59
+ # creates a Math::Expon class from a yaml file which must have the
60
+ # relevant fields:
61
+ #
62
+ # +x_start+
63
+ # +x_end+
64
+ # +y_start+
65
+ # +y_end+
66
+ # +tau+
67
+ #
68
+ def from_yaml(yh)
69
+ args = [yh['y_start'], yh['y_end'], yh['x_start'], yh['x_end'], yh['tau']]
70
+ new(*args)
71
+ end
72
+
73
+ end
74
+
54
75
  private
55
76
 
56
77
  def setup
@@ -62,7 +83,6 @@ module Math
62
83
 
63
84
  @a = (CMath::log(exp_ev) - CMath::log(exp_sv)) / x_length;
64
85
  @b= CMath::log(exp_sv) - (self.a * x_start);
65
-
66
86
  end
67
87
 
68
88
  end
@@ -55,6 +55,14 @@ module Math
55
55
  ''
56
56
  end
57
57
 
58
+ class << self
59
+
60
+ def from_yaml(yh)
61
+ new
62
+ end
63
+
64
+ end
65
+
58
66
  private
59
67
 
60
68
  def setup
@@ -42,6 +42,26 @@ module Math
42
42
  "a: #{self.a}\nb: #{self.b}"
43
43
  end
44
44
 
45
+ class << self
46
+
47
+ #
48
+ # +from_yaml(yaml_hash)+:
49
+ #
50
+ # creates a Math::Line class from a yaml file which must have the
51
+ # relevant fields:
52
+ #
53
+ # +x_start+
54
+ # +x_end+
55
+ # +y_start+
56
+ # +y_end+
57
+ #
58
+ def from_yaml(yh)
59
+ args = [yh['y_start'], yh['y_end'], yh['x_start'], yh['x_end']]
60
+ new(*args)
61
+ end
62
+
63
+ end
64
+
45
65
  private
46
66
 
47
67
  def setup
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mext
2
- VERSION = "0.4.1"
2
+ VERSION = '0.5.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-mext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicola Bernardini