Skip to content

raviqqe/block-is-array

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

block-is-array

Build Status License

Block is Array

Installation

$ gem install block-is-array

Usage

Code:

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:

[[:user, :www], [:http, [[:server, [[:listen, 80], [:server_name, "foo.com"]]], [:server, [[:listen, 443, :ssl], [:server_name, "bar.com"]]]]]]

For more examples, see examples directory.

License

The Unlicense