- Reduces coupling
- Enables refactoring
Throw something weird at people to keep their attention. Bored people don't learn anything, so focus on entertainment over being informative.
| module AwesomeResource | |
| attr_reader :awesome_attributes | |
| def initialize(attributes={}) | |
| @awesome_attributes = attributes | |
| @awesome_attributes.keys.each do |method_name| | |
| create_method(method_name.to_sym) do | |
| @awesome_attributes[method_name] | |
| end |
| App = Ember.Application.create(); | |
| App.IndexRoute = Ember.Route.extend({ | |
| model: function() { | |
| return EmberFire.Array.create({ | |
| ref: new Firebase("https://dp-ember-chat.firebaseio.com/") | |
| }); | |
| } | |
| }); |