Skip to content

Instantly share code, notes, and snippets.

View mmower's full-sized avatar
💭
Writing code

Matt Mower mmower

💭
Writing code
View GitHub Profile
# ruby beginner elevator program
# We might break this stuff up into more classes as the need to separate state and
# behaviour of different entities emerges, for now we keep it simple and imagine
# the state to be that of the building as a whole.
#
class Building
GROUND_FLOOR = 0
@mmower
mmower / gist:11041
Created September 16, 2008 15:04 — forked from wilson/gist:11036
# Used to modify the relationship tags applied to the specified contact
#
# PUT /users/bob/contacts/alice/tags?friend=t&family=f
#
# Sets the tags on the relationship that 'bob' has with 'alice' to be 'friend' and not 'family'
#
def tags
@contact = user.contacts.with_login( params[:id] )
@relationship = user.relationships.with( @contact )
@relationship.set( tags_from_params( params ) )