Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
70 lines (53 sloc) 2.07 KB
Aiming to make the moo API almost as easy to use for developers as the site itself.
If you've never installed a gem from github before - enter the following and you will eternally be graced by a thousand minds:
gem sources -a
Then you can install this like any other gem:
gem install infovore-ruminant
All parameters are done in an ActiveRecord attributes style, i.e. they can be passed into new() as a hash, and are all attr-accessors. Note that product objects do not have attributes that are not impossible for that product, and that a Sticker will raise an error if you try to give it text.
Making an order:
require 'rubygems'
require 'moo'
order = => "your api key")
Adding a product:
moocard = => "http://farm...")
order.designs << moocard
Adding text
moocard.text = "This is line 1 \n This is line 2"
moocard.line(1) #=> This is line 1
moocard.line(1).bold = true
moocard.line(1).align = "right"
moocard.line(1).font = "modern"
moocard.line(1).colour = "#444444"
moocard.bold = true # sets bold=true on all lines
Submitting to moo:
order.to_xml # Gives you the generated xml if you want to manually submit it
if order.error?
Current Limitations
Currently I only support MiniCards and Stickers, but have made it incredibly easy to add the other supported products.
I haven't yet, as I do not have a personal need, so don't feel I can test it. If you have such a need, do let me know, as we can add it.
Manual Cropping is not currently supported for the same reason.
Please please please do feel to give feedback and/or submit patches. I want this library to be as helpful as possible, but can only do that if I know what you want.
Contributors thus far
Xenia Kingsley - Naming powers
Chris Mear - Fixing stuff, and provides the wine
Dan Webb - Wisdom
Tom Armitage - adding Moo::Sticker
/ | ||
* ||----||
~~ ~~
You can’t perform that action at this time.