object-send
Version, currently 0.2.03 versions
- 0.3.1latestAug 9, 2019
- 0.3.0not indexedAug 9, 2019
- 0.2.0not indexedAug 9, 2019
github.com/j8r/crystal-object-send
Interpret a String to an Object method call
14 stars
0 dependents
License: ISC
Nothing has been indexed for 0.2.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
object-send:
github: j8r/crystal-object-send
version: ~> 0.2.0Then run:
shards installshard.yml
No shard.yml has been indexed for 0.2.0. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
# Crystal Object#send
[](https://cloud.drone.io/j8r/crystal-object-send)
[](https://en.wikipedia.org/wiki/ISC_license)
Interpret a String to an Object method call.
Similar to the Ruby's `Object#send`.
Here macros and the `Crystal::Parser` are used to build a pseudo interpreter.
## Disclaimer
There are lots of limitations, this library is mainly an experiment.
Usually you better avoid using it and interpret the string on your own. It would be more performant and safer.
## Installation
Add the dependency to your `shard.yml`:
```yaml
dependencies:
object-send:
github: j8r/crystal-object-send
```
## Examples
```cr
"abc".send "chars" #=> ['a', 'b', 'c']
"abc".send "lchop('a')" #=> "bc"
"abc".send "insert 1, 'z'" #=> "azbc"
2.send("+ 3") #=> 5
var = "first 2"
[0, 1, 3].send(var) #=> [0, 1]
[0, 1, 2].send("[-1]?") #=> eq 2
[0, 1, 2].send("[..]") #=> eq [0, 1, 2]
```
See more in the [specs](spec/object_send_spec.cr)
## License
Copyright (c) 2019 Julien Reichardt - ISC License
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.2.0- Tagged
- Aug 9, 2019
- Commit
86e5900cc695- Indexed
- not yet
Dependents
No indexed shard depends on this one yet.
Repository
github.com/j8r/crystal-object-send
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 13, 2026
- Synced
- Aug 13, 2026
- Versions
- 3