block-is-array 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2a1110377dc0aa0a7f8c37822b9c1851dc9d5549
4
+ data.tar.gz: fba96838ebd25d03dbbae5950f88f54c6af94b1a
5
+ SHA512:
6
+ metadata.gz: 8b4e38acdd1e3991e1afc10a306d847a3bcd327c169a845174c081b4a6573bf338a8f0b9e3ed2dcc233bc7b7ec4f7a6839780b5a25296bf6afcf5ac0f01884b2
7
+ data.tar.gz: 2315bbe46edb823de1a356b3399f3278b252e8138599750f30eb72cc2becab60d47d5753857c3a84c7c6ed712b083c785c581203f4ca2bd752c8541afdb1d91e
@@ -0,0 +1 @@
1
+ require_relative 'block-is-array/function'
@@ -0,0 +1,18 @@
1
+ class BlockIsArray
2
+ def initialize &block
3
+ @array = []
4
+ instance_eval(&block)
5
+ end
6
+
7
+ def method_missing name, *args, &block
8
+ if block
9
+ args.push BlockIsArray.new(&block).to_array
10
+ end
11
+
12
+ @array.push args.unshift(name)
13
+ end
14
+
15
+ def to_array
16
+ @array
17
+ end
18
+ end
@@ -0,0 +1,7 @@
1
+ require_relative 'class'
2
+
3
+
4
+
5
+ def block_is_array &block
6
+ BlockIsArray.new(&block).to_array
7
+ end
metadata ADDED
@@ -0,0 +1,46 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: block-is-array
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Yota Toyama
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-10-23 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: block-to-array converter
14
+ email: raviqqe@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/block-is-array.rb
20
+ - lib/block-is-array/class.rb
21
+ - lib/block-is-array/function.rb
22
+ homepage: https://github.com/raviqqe/block-is-array
23
+ licenses:
24
+ - Unlicense
25
+ metadata: {}
26
+ post_install_message:
27
+ rdoc_options: []
28
+ require_paths:
29
+ - lib
30
+ required_ruby_version: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ required_rubygems_version: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ requirements: []
41
+ rubyforge_project:
42
+ rubygems_version: 2.5.1
43
+ signing_key:
44
+ specification_version: 4
45
+ summary: Block is Array
46
+ test_files: []