module Refinery::VimeoVideos::Account

Constants

CONSUMER_KEY_FORMAT

This will extend controllers and models to centralize account setup logic

CONSUMER_SECRET_FORMAT
SECRET_FORMAT
TOKEN_FORMAT

Protected Instance Methods

account() click to toggle source
# File lib/refinerycms-vimeo-videos/account.rb, line 22
def account
  @account ||= {
    :username => RefinerySetting.find_or_set(:vimeo_username, :value => "Username"),
    :consumer_key => RefinerySetting.find_or_set(:vimeo_consumer_key, :value => "Consumer Key"),
    :consumer_secret => RefinerySetting.find_or_set(:vimeo_consumer_secret, :value => "Consumer Secret"),
    :token => RefinerySetting.find_or_set(:vimeo_token, :value => 'Token'),
    :secret => RefinerySetting.find_or_set(:vimeo_secret, :value => 'Secret')}
end
authorized?() click to toggle source
# File lib/refinerycms-vimeo-videos/account.rb, line 18
def authorized?
  account[:token] =~ TOKEN_FORMAT and account[:secret] =~ SECRET_FORMAT
end
ready_to_authorize?() click to toggle source
# File lib/refinerycms-vimeo-videos/account.rb, line 14
def ready_to_authorize?
  account[:consumer_key] =~ CONSUMER_KEY_FORMAT and account[:consumer_secret] =~ CONSUMER_SECRET_FORMAT
end