mixture 0.3.2 → 0.3.4
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/mixture/attribute_list.rb +2 -1
- data/lib/mixture/coerce/range.rb +14 -0
- data/lib/mixture/types/range.rb +12 -0
- data/lib/mixture/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d25bc15d792a71b8658ed14b6ff94857b35fa49f
|
4
|
+
data.tar.gz: 3c23c853b6f15e0cd2a75f8720e5278f9efdde31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3449ef65cead66e3b90ae855660142e93f8420c0ea042cab17f6b2cfaf64d4bb038b92f38eee5e6c8031b0e53b20197a71a4e377758c69140a7bf47530da1e3f
|
7
|
+
data.tar.gz: 9296f2af91da81d4ddee16dfac37ead7b504789a3cab32f3e4d9aa23bcb68af74ecaf9c8337acbd23ded20329a73592d42c143900e0c970b4089d3ad8e5bd4b8
|
data/Gemfile.lock
CHANGED
@@ -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
|
data/lib/mixture/version.rb
CHANGED
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.
|
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-
|
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
|