https://github.com/raviqqe/block-is-array
Block is Array (See also https://github.com/raviqqe/block-is-hash)
https://github.com/raviqqe/block-is-array
metaprogramming ruby
Last synced: 6 months ago
JSON representation
Block is Array (See also https://github.com/raviqqe/block-is-hash)
- Host: GitHub
- URL: https://github.com/raviqqe/block-is-array
- Owner: raviqqe
- License: unlicense
- Created: 2016-10-23T05:06:50.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-10-23T06:14:28.000Z (over 9 years ago)
- Last Synced: 2024-05-02T01:07:25.672Z (almost 2 years ago)
- Topics: metaprogramming, ruby
- Language: Ruby
- Homepage:
- Size: 26.4 KB
- Stars: 20
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# block-is-array
[](https://travis-ci.org/raviqqe/block-is-array)
[](https://unlicense.org)
Block is Array
## Installation
```
$ gem install block-is-array
```
## Usage
Code:
```ruby
require 'block-is-array'
array = block_is_array do
user :www
http do
server do
listen 80
server_name 'foo.com'
end
server do
listen 443, :ssl
server_name 'bar.com'
end
end
end
p array
```
Output:
```ruby
[[:user, :www], [:http, [[:server, [[:listen, 80], [:server_name, "foo.com"]]], [:server, [[:listen, 443, :ssl], [:server_name, "bar.com"]]]]]]
```
For more examples, see [examples](examples) directory.
## License
[The Unlicense](https://unlicense.org)