Created
January 10, 2013 10:29
-
-
Save krainboltgreene/4501076 to your computer and use it in GitHub Desktop.
This file contains 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
Account -> | |
attributes("name", "password") | |
setup: method(name, password) -> | |
name(name) | |
password(password) | |
tweets: method -> | |
Twitter get_tweets name: name, password: password | |
account: Account make(name: "krainboltgreene", password: "12341234") | |
window -> | |
stack(title: "Account") -> | |
row -> | |
"Username: {{account name}}" | |
row -> | |
"Mentions {{account mentions size}}" | |
stack(title: "Tweets") -> | |
tweets each -> tweet | |
row -> | |
"{{tweet user name}}: {{tweet message}}" |
This file contains 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
class Account | |
attr_accessor :name, :password | |
def initialize(name, password) | |
@name = name | |
@password = password | |
end | |
def tweets | |
Twitter.get_tweets name, password | |
end | |
end | |
account = Account.new "krainboltgreene", "12341234" | |
window do | |
stack title: "Account" do | |
row { "Username: #{account.name}"} | |
row { "Mentions: #{account.mentions.size}"} | |
end | |
stack title: "Tweets" do | |
account.tweets.each do |tweet| | |
row { "#{tweet.user.name}: #{tweet.message}" } | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment