Created
November 23, 2016 23:17
-
-
Save beck03076/96113f621f6369531f76a1e517f7aae1 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
class SearchController | |
def search_repos | |
platform = Favorito::Platform.new(:github, { per_page: 10 }) | |
client = Favorito::Client.create(platform) | |
client.repos('beck03076') | |
end | |
end | |
module Favorito | |
# ==================== Client ============== | |
class Client | |
class << self | |
def create(platform) | |
platform_klass::Client.new(platform.options) | |
end | |
private | |
def platform_klass | |
platform.name.to_s.classify.constantize | |
end | |
end | |
end | |
# ==================== PLatform ============== | |
class Platform | |
attr_accessor :name, :options | |
def initialize(name, opts = {}) | |
@name = name | |
@options = opts | |
end | |
end | |
end | |
module Github | |
class Client | |
def self.repos(username) | |
end | |
end | |
end | |
module Bitbucket | |
class Client | |
def self.repos(username) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment