Skip to content

Instantly share code, notes, and snippets.

@latompa
Created July 6, 2009 19:57
Show Gist options
  • Save latompa/141643 to your computer and use it in GitHub Desktop.
Save latompa/141643 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'activesupport'
module Fleykr
mattr_accessor :token
def self.search_photos
p "searching, and my token is #{Fleykr.token}"
end
end
Fleykr.token="123"
Fleykr.token="456"
Fleykr.search_photos
# output "searching, and my token is 456"
class FleykrSearch
include Fleykr
def initialize(token)
self.token=token
end
def search
Fleykr.search_photos
end
end
search1=FleykrSearch.new "123"
search2=FleykrSearch.new "456"
search1.search
search2.search
# output
# "searching, and my token is 456"
# "searching, and my token is 456"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment