Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
leonovk committed Dec 1, 2023
1 parent d117eee commit 3a30c05
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,18 @@ user = User.new
user.yaml.kek.lol # output: 'text'
user.yaml.kek.users.first # output: '1'
```
If you complete the chain not to the final value. You will get an object like a hash. It won't respond to []. However, you can use a dot to go through the values further.
If you complete the chain not to the final value. You will get an object like a hash. It won't respond to []. However, you can use a dot to go through the values further. You can also use data from Yaml files inside your model.

```ruby
class User < ActiveYaml::Base
yaml 'examples/example.yaml'

# The method will return "text"
def test_method
yaml.kek.lol
end
end
```

### Contribution

Expand Down

0 comments on commit 3a30c05

Please sign in to comment.