Skip to content

Instantly share code, notes, and snippets.

@sheldonh
Created November 2, 2012 13:57
Show Gist options
  • Select an option

  • Save sheldonh/4001504 to your computer and use it in GitHub Desktop.

Select an option

Save sheldonh/4001504 to your computer and use it in GitHub Desktop.
repo exploration
# E.g.
#
# InteractionRepo.with_interaction_for_message(m) do |i|
# i.add_response(m)
# i.call_back
# end
class InteractionRepo
def with_interaction_for_message(message)
dto = InteractionDataAccessor.find_by_token message.token
interaction = to_entity(dto)
if yield interaction
InteractionDataAccessor.store to_dto(entity)
end
end
private
def to_entity(dto)
InteractionDataMapper.new.to_entity(dto)
end
def to_dto(dto)
InteractionDataMapper.new.to_dto(dto)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment