diff options
| author | Teddy Wing | 2014-06-08 07:16:49 -0400 | 
|---|---|---|
| committer | Teddy Wing | 2014-06-08 07:16:49 -0400 | 
| commit | 9f033f1558c67484c545ff3610b2c866603a6eef (patch) | |
| tree | 19dad9dfb06958a481134d82ca053c599e8ca547 | |
| parent | 2570476fff3ad2d43816fc5aeace567765b86f4f (diff) | |
| download | sellevate-9f033f1558c67484c545ff3610b2c866603a6eef.tar.bz2 | |
FancyBear::ContextIO::Auth: move initializer to Base class
I need a ContextIO instance in another module class so let's create a
base class so I don't have to keep doing it.
| -rw-r--r-- | fancy_bear/contextio.rb | 1 | ||||
| -rw-r--r-- | fancy_bear/contextio/auth.rb | 6 | ||||
| -rw-r--r-- | fancy_bear/contextio/base.rb | 13 | 
3 files changed, 15 insertions, 5 deletions
| diff --git a/fancy_bear/contextio.rb b/fancy_bear/contextio.rb index 88fc988..dc3f9ff 100644 --- a/fancy_bear/contextio.rb +++ b/fancy_bear/contextio.rb @@ -1,4 +1,5 @@  require_relative 'contextio/config' +require_relative 'contextio/base'  require_relative 'contextio/auth'  module FancyBear diff --git a/fancy_bear/contextio/auth.rb b/fancy_bear/contextio/auth.rb index 174648a..1288b6d 100644 --- a/fancy_bear/contextio/auth.rb +++ b/fancy_bear/contextio/auth.rb @@ -3,11 +3,7 @@ require 'contextio'  module FancyBear    module ContextIO -    class Auth -      def initialize -        @contextio = ::ContextIO.new(API_KEY, API_SECRET) -      end -       +    class Auth < Base        def connect(callback_url)          connection_token = @contextio.connect_tokens.create(callback_url)          connection_token.browser_redirect_url diff --git a/fancy_bear/contextio/base.rb b/fancy_bear/contextio/base.rb new file mode 100644 index 0000000..84473d1 --- /dev/null +++ b/fancy_bear/contextio/base.rb @@ -0,0 +1,13 @@ +require 'contextio' + +module FancyBear +  module ContextIO +     +    class Base +      def initialize +        @contextio = ::ContextIO.new(API_KEY, API_SECRET) +      end +    end +     +  end +end | 
