The new Instant Ruby API for Agree2 Templates

Posted by Pelle edit

How do you get from this:

An Agree2 Template

To this:

# This creates an agreement from the template
@agreement=Agree2::OptionForHolderToBuyAssetTemplate.prepare( :holder =>"John Doe",
    :asset =>"Consulting by Pelle Braendgaard",
    :amount =>"10",
    :units =>"hours",
    :price =>"$100/h",
    :valid_to =>"1 month from now")

# invite the parties
@party=@agreement.invite("johndoe@mailinator.com","John","Doe")
@party=@agreement.invite("pelle@stakeventures.com","Pelle","Brændgaard")

# Change something in the contract
@agreement.amount=20
@agreement.save

# Mark it as being final and ready to accept
@agreement.finalize

Hint try clicking on the Instant Ruby API in your Agree2 template:

Agree2 Template alternative formats

Read more in the New Instant Ruby API for Agree2 Templates post on the Extra Eagle Blog.

Later on this week I will explain how we did it and how you can create an Instant Ruby API in your own rails application.

Posted November 4th, 2007 under:
Comments

Leave a response

Comment