rfunk 1.8.1 → 1.9.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 57057306c9779f3353bfb68dd9aaefbda014c97c
4
- data.tar.gz: '09b784e675d3c21ff2f0410d4403ff70018c9a20'
3
+ metadata.gz: 8c7642b3ee9e59a101c800bc98159de506ac38b2
4
+ data.tar.gz: 48913794e0cc022b47b5ef3191a9393e8faf4c95
5
5
  SHA512:
6
- metadata.gz: ad801d1cc9abf2f81a6991878baa95564d7f277557ecd44a684611f13395ed09292927d59a34f494cf4b673318c5a6e0cc3cde4830eebda4b689d116a72ac766
7
- data.tar.gz: a08e516f2075689c6e0cb950d988b0c92dbffbabda623cb43833b3d84084c3a781f835353602051cc6792d40df72f3d737e11a7e6ad3c84213d38dbf4546ebad
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
- RFunk.lazy(-> { RFunk::ErrorChecking.new }).value
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)
@@ -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
- def each(&block)
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
@@ -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
- return false unless self.class == other.class
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
@@ -1,3 +1,3 @@
1
1
  module RFunk
2
- VERSION = '1.8.1'.freeze
2
+ VERSION = '1.9.0'.freeze
3
3
  end
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.8.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-04-21 00:00:00.000000000 Z
11
+ date: 2017-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby