Sha256: e794ccf08d7c8d3b55ba1ad43c3ceac5fd326de175e637701f3cdd4322bf60f9

Contents?: true

Size: 1.32 KB

Versions: 6

Compression:

Stored size: 1.32 KB

Contents

# GetXkcd

This library provides methods to get the JSON data for either the most recent [XKCD](https://xkcd.com/) comic or a random one, and then return the JSON data as a Ruby Hash.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'get_xkcd'
```

And then execute:

```
$ bundle install
```

Or install it yourself as:

```
$ gem install get_xkcd
```

## Usage

Require the gem in your application file if necessary (e.g. if using Rails, this won't be necessary as Rails takes care of this for you):

```ruby
require 'get_xkcd'
```

Get data for the latest comic:

```ruby
latest_issue_data = GetXkcd::Comic.fetch_latest_issue_data
```

Get data for a specific comic:

```ruby
specific_issue_data = GetXkcd::Comic.fetch_specific_issue_data(issue_number)
```

Get data for the a random comic:

```ruby
random_issue_data = GetXkcd::Comic.fetch_random_issue_data
```

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/superchilled/get-xkcd.

## License

The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
get_xkcd-0.2.5 README.md
get_xkcd-0.2.4 README.md
get_xkcd-0.2.3 README.md
get_xkcd-0.2.2 README.md
get_xkcd-0.2.1 README.md
get_xkcd-0.2.0 README.md