rfunk 1.8.1 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rfunk/attribute/attribute_definition.rb +2 -8
- data/lib/rfunk/attribute/function.rb +2 -4
- data/lib/rfunk/maybe/option.rb +2 -5
- data/lib/rfunk/maybe/some.rb +1 -4
- data/lib/rfunk/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: 8c7642b3ee9e59a101c800bc98159de506ac38b2
|
4
|
+
data.tar.gz: 48913794e0cc022b47b5ef3191a9393e8faf4c95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7f3e9bb72b3ae3586dbc82bffc3552332ab9e60f090ae706e88c7c4e43e2525c05fcc04fa7fec179899ea0fb1f510f794794af7d4bf6dbca3840ee313abd2ef
|
7
|
+
data.tar.gz: 28f219fd74fa60e2e824ae171ec0b9f8fca911f75aac1b5167022a7f34e21ae745625399dd7a7df7704f10e2c0357cee4e5a2faa53d7e016e728cf381beaccc9
|
@@ -1,11 +1,7 @@
|
|
1
1
|
module RFunk
|
2
2
|
module AttributeDefinition
|
3
3
|
def attribute(name, type, options = {})
|
4
|
-
RFunk::AttributeVariable.new.add(instance: self,
|
5
|
-
name: name,
|
6
|
-
type: type,
|
7
|
-
options: options)
|
8
|
-
|
4
|
+
RFunk::AttributeVariable.new.add(instance: self, name: name, type: type, options: options)
|
9
5
|
create_method(name, type)
|
10
6
|
end
|
11
7
|
|
@@ -15,9 +11,7 @@ module RFunk
|
|
15
11
|
define_method(name) do |value = nil|
|
16
12
|
if value
|
17
13
|
RFunk::ErrorChecking.new.raise_expected_attribute_type(name, value, type)
|
18
|
-
RFunk::Immutable.new.create(instance: self,
|
19
|
-
variable_name: variable_name(name),
|
20
|
-
value: value)
|
14
|
+
RFunk::Immutable.new.create(instance: self, variable_name: variable_name(name), value: value)
|
21
15
|
else
|
22
16
|
RFunk.option(instance_variable_get(variable_name(name)))
|
23
17
|
end
|
@@ -77,13 +77,11 @@ module RFunk
|
|
77
77
|
end
|
78
78
|
|
79
79
|
def error_checking
|
80
|
-
|
80
|
+
@error_checking ||= RFunk::ErrorChecking.new
|
81
81
|
end
|
82
82
|
|
83
83
|
def validate_return_type(return_value)
|
84
|
-
error_checking.raise_expected_return_type(function_name.value,
|
85
|
-
return_value,
|
86
|
-
type_annotation.return)
|
84
|
+
error_checking.raise_expected_return_type(function_name.value, return_value, type_annotation.return)
|
87
85
|
end
|
88
86
|
|
89
87
|
def validate_parameter_types(*args)
|
data/lib/rfunk/maybe/option.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
module RFunk
|
2
2
|
class Option
|
3
3
|
include Enumerable
|
4
|
+
extend Forwardable
|
4
5
|
|
5
6
|
class << self
|
6
7
|
def inherited(subclass)
|
@@ -11,11 +12,7 @@ module RFunk
|
|
11
12
|
attr_reader :descendants
|
12
13
|
end
|
13
14
|
|
14
|
-
|
15
|
-
return enum_for(:enum) if block.nil?
|
16
|
-
|
17
|
-
enum.each { |v| yield v }
|
18
|
-
end
|
15
|
+
def_delegators :enum, :each
|
19
16
|
end
|
20
17
|
|
21
18
|
class << self
|
data/lib/rfunk/maybe/some.rb
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
module RFunk
|
2
2
|
class Some < Option
|
3
|
-
extend Forwardable
|
4
|
-
|
5
3
|
class << self
|
6
4
|
def create(value)
|
7
5
|
new(value)
|
@@ -34,8 +32,7 @@ module RFunk
|
|
34
32
|
end
|
35
33
|
|
36
34
|
def ==(other)
|
37
|
-
|
38
|
-
value == RFunk.option(other).value
|
35
|
+
value == other.value
|
39
36
|
end
|
40
37
|
|
41
38
|
def <=>(other)
|
data/lib/rfunk/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rfunk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Falkowski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|