{"action":"opened","issue":{"url":"https://api.github.com/repos/lemonsweets/oystercard/issues/21","labels_url":"https://api.github.com/repos/lemonsweets/oystercard/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/lemonsweets/oystercard/issues/21/comments","events_url":"https://api.github.com/repos/lemonsweets/oystercard/issues/21/events","html_url":"https://github.com/lemonsweets/oystercard/issues/21","id":100750944,"number":21,"title":"touch_in_out.md","user":{"login":"lemonsweets","id":12461822,"avatar_url":"https://avatars.githubusercontent.com/u/12461822?v=3","gravatar_id":"","url":"https://api.github.com/users/lemonsweets","html_url":"https://github.com/lemonsweets","followers_url":"https://api.github.com/users/lemonsweets/followers","following_url":"https://api.github.com/users/lemonsweets/following{/other_user}","gists_url":"https://api.github.com/users/lemonsweets/gists{/gist_id}","starred_url":"https://api.github.com/users/lemonsweets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lemonsweets/subscriptions","organizations_url":"https://api.github.com/users/lemonsweets/orgs","repos_url":"https://api.github.com/users/lemonsweets/repos","events_url":"https://api.github.com/users/lemonsweets/events{/privacy}","received_events_url":"https://api.github.com/users/lemonsweets/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-13T11:55:04Z","updated_at":"2015-08-13T11:55:04Z","closed_at":null,"body":"Now that we have a card that can be topped up and can be used to spend money, we can make it support touch in/out events.\n\nLet's start with something simple: let the card be aware whether it's being used on a journey or not. If it was used to touch in but the user didn't touch out yet, it'll be \"in use\".\n\nTo close this issue, you'll need to test-drive three methods: `touch_in`, `touch_out` and `in_use?`. Don't try to write all tests in one go: consider the test that you can write first that will rely on only one method and then write more complex tests.\n\n## Skills you will learn:\n- S147: Set an instance variable\n- S160: Update the value of an instance variable\n- S180: Write custom attribute accessors\n- S181: Use boolean variables\n- S183: Use predicate methods\n- S184: Use RSpec predicate matchers\n\n## Interview questions you may expect:\n- I164: What are instance variables and how they are different from local variables?\n- I182: Why some Ruby methods end with a question mark? What are they expected to return?\n\n## To complete this challenge:\n- [ ] Write tests for `touch_in`, `touch_out` and `in_use?` methods\n- [ ] Write implementation of these methods that will make the tests pass\n- [ ] Use an instance variable to track whether the card is in use\n- [ ] Use an RSpec predicate matcher to check if the card is in use\n- [ ] Use boolean values to store the state of the card\n\n## Suggested resources:\n- [Ruby instance variables](https://rubymonk.com/learning/books/4-ruby-primer-ascent/chapters/45-more-classes/lessons/110-instance-variables)\n- [Boolean data type](https://en.wikipedia.org/wiki/Boolean_data_type)\n- [Predicate methods](http://pragmati.st/2012/03/24/the-elements-of-ruby-style-predicate-methods/)\n- [RSpec predicate matchers](https://www.relishapp.com/rspec/rspec-expectations/v/3-3/docs/built-in-matchers/predicate-matchers)"}}