Created
November 2, 2012 13:57
-
-
Save sheldonh/4001504 to your computer and use it in GitHub Desktop.
repo exploration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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