Skip to content

Commit

Permalink
Update README and gem version
Browse files Browse the repository at this point in the history
  • Loading branch information
mntnorv committed May 15, 2015
1 parent ed9baba commit 2c3270c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,34 @@ false.to_lua # false
nil.to_lua # nil
```

### Options
#### Pretty formatting

```ruby
{a: 'hash', with: {a_nested: 'hash'}}.to_lua(pretty: true)

# {
# ["a"] = "hash",
# ["with"] = {
# ["a_nested"] = "hash"
# }
# }

```

#### Custom indentation

```ruby
{a: 'hash', with: {a_nested: 'hash'}}.to_lua(pretty: true, indent: '')

# {
# ["a"] = "hash",
# ["with"] = {
# ["a_nested"] = "hash"
# }
# }
```

## Custom objects

Custom objects can define the `as_lua` method. The return value will be
Expand Down
3 changes: 1 addition & 2 deletions to_lua.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

Gem::Specification.new do |s|
s.name = 'to_lua'
s.version = '0.0.1'
s.version = '0.1.0'
s.date = '2015-05-14'
s.summary = 'Serialize objects to lua tables'
s.authors = ['Mantas Norvaiša']
s.email = '[email protected]'
s.files = ['lib/hola.rb']
s.homepage = 'https://github.com/mntnorv/to_lua'
s.license = 'MIT'

Expand Down

0 comments on commit 2c3270c

Please sign in to comment.