Skip to content

irasutoya-tools/irasutoya

Repository files navigation

Irasutoya

Gem Version Code Climate codecov Libraries.io dependency status for GitHub repo GitHub

Irasutoya is ruby library for いらすとや

Installation

Add this line to your application's Gemfile:

gem 'irasutoya'

Usage

# Irasuto
irasuto = Irasutoya::Irasuto.random #=> returns Irasuto instance
irasuto.url
irasuto.title
irasuto.description
irasuto.image_url
irasuto.image_urls
irasuto.has_maltiple_images
irasuto.postthumb_image_url

irasuto_links = Irasutoya::Irasuto.search(query: 'おじさん', page: 3) #=> returns array of IrasutoLink instance

# Category
categories = Irasutoya::Category.all #=> returns array of Category instance
category = categories.first
category.title
category.list_url

irasuto_links = category.fetch_irasuto_links #=> returns array of IrasutoLink instance

# IrasutoLinks
irasuto_link = irasuto_links.first
irasuto_link.title
irasuto_link.show_url

irasuto = irasuto_link.fetch_irasuto #=> returns Irasuto instance

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/irasutoya-tools/irasutoya. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Irasutoya project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.