Typhoid
A lightweight ORM-like wrapper around Typhoeus
Installation
Add this line to your application's Gemfile:
gem 'typhoid'
And then execute:
$ bundle
Or install it yourself as:
$ gem install typhoid
Usage
Class Setup
require 'typhoid'
class Game < Typhoid::Resource
field :id # What fields we want to deal with on a response/request
field :team_1_name
field :team_2_name
field :start_time
self.site = 'http://localhost:3000/' # The base-url for where we plan to retrieve data
self.path = 'games/' # Specific path to get the data for this Class
def self.get_game
build_request("http://localhost:3000/games/1")
end
end
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Write some tests (Yes now.. [
vim spec/...
]) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request