Created
January 22, 2015 14:24
-
-
Save asterite/cc29466677b4824a05ae to your computer and use it in GitHub Desktop.
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
require "ecr/macros" | |
record Person, name, age | |
class PersonView | |
getter person | |
def initialize(@person) | |
end | |
ecr_file "person_view.ecr" | |
end | |
person = Person.new "John", 20 | |
view = PersonView.new person | |
puts view.to_s |
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
Hi, I'm <%= person.name %> and I'm <%= person.age %> years old |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment