mixture 0.3.2 → 0.3.4

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
  SHA1:
3
- metadata.gz: 5c8c8801295aa86e683119fa365df2fd15c80816
4
- data.tar.gz: e9ec965a80f069d50e50b1997d13e1f5dab3d978
3
+ metadata.gz: d25bc15d792a71b8658ed14b6ff94857b35fa49f
4
+ data.tar.gz: 3c23c853b6f15e0cd2a75f8720e5278f9efdde31
5
5
  SHA512:
6
- metadata.gz: a3423a7c7d910fbf8e70e51b8fc22505774e9f6b6de60d063e29cbfaba7f8652b4d0c455c00994a5661e2167fe509417154255ebaf01a3ca2ee05a8b740064aa
7
- data.tar.gz: 26d4de5767aebb91b9ff0669d3dab43a5f0bcc70aa0e100d8c071cdec64a39c2b55617da06643cb41624fb430ff76933f5ba5a89962befc27ad807a5980f8c52
6
+ metadata.gz: 3449ef65cead66e3b90ae855660142e93f8420c0ea042cab17f6b2cfaf64d4bb038b92f38eee5e6c8031b0e53b20197a71a4e377758c69140a7bf47530da1e3f
7
+ data.tar.gz: 9296f2af91da81d4ddee16dfac37ead7b504789a3cab32f3e4d9aa23bcb68af74ecaf9c8337acbd23ded20329a73592d42c143900e0c970b4089d3ad8e5bd4b8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mixture (0.3.2)
4
+ mixture (0.3.4)
5
5
  thread_safe (~> 0.3)
6
6
 
7
7
  GEM
@@ -1,5 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
+ require "set"
3
4
  require "forwardable"
4
5
 
5
6
  module Mixture
@@ -30,7 +31,7 @@ module Mixture
30
31
  def initialize
31
32
  @list = {}
32
33
  @options = {}
33
- @callbacks = Hash.new { |h, k| h[k] = [] }
34
+ @callbacks = Hash.new { |h, k| h[k] = Set.new }
34
35
  end
35
36
 
36
37
  # Creates a new attribute with the given name and options.
@@ -0,0 +1,14 @@
1
+ # encoding: utf-8
2
+
3
+ module Mixture
4
+ module Coerce
5
+ # Handles coercion of the Integer class.
6
+ class Range < Base
7
+ type Types::Range
8
+
9
+ coerce_to(Types::Object, Itself)
10
+ coerce_to(Types::String, :to_s)
11
+ coerce_to(Types::Array, :to_a)
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,12 @@
1
+ # encoding: utf-8
2
+
3
+ module Mixture
4
+ module Types
5
+ # The range type.
6
+ class Range < Enumerable
7
+ options[:primitive] = ::Range
8
+ options[:method] = :to_range
9
+ as :range
10
+ end
11
+ end
12
+ end
@@ -5,5 +5,5 @@ module Mixture
5
5
  # The current version of Mixture.
6
6
  #
7
7
  # @return [String]
8
- VERSION = "0.3.2"
8
+ VERSION = "0.3.4"
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mixture
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Rodi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-12 00:00:00.000000000 Z
11
+ date: 2015-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -98,6 +98,7 @@ files:
98
98
  - lib/mixture/coerce/integer.rb
99
99
  - lib/mixture/coerce/nil.rb
100
100
  - lib/mixture/coerce/object.rb
101
+ - lib/mixture/coerce/range.rb
101
102
  - lib/mixture/coerce/rational.rb
102
103
  - lib/mixture/coerce/set.rb
103
104
  - lib/mixture/coerce/string.rb
@@ -125,6 +126,7 @@ files:
125
126
  - lib/mixture/types/nil.rb
126
127
  - lib/mixture/types/numeric.rb
127
128
  - lib/mixture/types/object.rb
129
+ - lib/mixture/types/range.rb
128
130
  - lib/mixture/types/rational.rb
129
131
  - lib/mixture/types/set.rb
130
132
  - lib/mixture/types/string.rb