Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yefim/upasteit-ruby
A Ruby wrapper for upasteit
https://github.com/yefim/upasteit-ruby
Last synced: about 9 hours ago
JSON representation
A Ruby wrapper for upasteit
- Host: GitHub
- URL: https://github.com/yefim/upasteit-ruby
- Owner: yefim
- Created: 2012-12-03T02:57:22.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2012-12-03T03:27:59.000Z (almost 12 years ago)
- Last Synced: 2024-04-15T03:17:11.147Z (7 months ago)
- Language: Ruby
- Size: 105 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Usage (paste and get)
### Setup
``` ruby
> require 'upasteit'
> geoffs_pastes = UPaste.new "geoff"
```### Paste
``` ruby
> geoffs_pastes.paste "how goes it?"
{
"id": 1,
"content": "how goes it?",
"created_at": "2012-12-02T22:22:50-05:00",
"user_id": 1
}
```### Paste more
``` ruby
> geoffs_pastes.paste %w(this is an array of strings)
[
{
"id": 2,
"content": "this",
"created_at": "2012-12-02T22:24:29-05:00",
"user_id": 1
},
{
"id": 3,
"content": "is",
"created_at": "2012-12-02T22:24:29-05:00",
"user_id": 1
},
{
"id": 4,
"content": "an",
"created_at": "2012-12-02T22:24:29-05:00",
"user_id": 1
},
{
"id": 5,
"content": "array",
"created_at": "2012-12-02T22:24:29-05:00",
"user_id": 1
},
{
"id": 6,
"content": "of",
"created_at": "2012-12-02T22:24:29-05:00",
"user_id": 1
},
{
"id": 7,
"content": "strings",
"created_at": "2012-12-02T22:24:29-05:00",
"user_id": 1
}
]
```### Get Pastes
``` ruby
> geoffs_pastes.get
[
{
"id": 2,
"content": "this",
"created_at": "2012-12-02T22:24:29-05:00",
"user_id": 1
},
{
"id": 3,
"content": "is",
"created_at": "2012-12-02T22:24:29-05:00",
"user_id": 1
},
{
"id": 4,
"content": "an",
"created_at": "2012-12-02T22:24:29-05:00",
"user_id": 1
},
{
"id": 5,
"content": "array",
"created_at": "2012-12-02T22:24:29-05:00",
"user_id": 1
},
{
"id": 6,
"content": "of",
"created_at": "2012-12-02T22:24:29-05:00",
"user_id": 1
},
{
"id": 7,
"content": "strings",
"created_at": "2012-12-02T22:24:29-05:00",
"user_id": 1
},
{
"id": 1,
"content": "how goes it?",
"created_at": "2012-12-02T22:22:50-05:00",
"user_id": 1
}
]
```