Skip to content

Commit

Permalink
Adding aliases for the attribute writters
Browse files Browse the repository at this point in the history
  • Loading branch information
roman committed Sep 7, 2009
1 parent 445e1d1 commit 24d0893
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions lib/warden_oauth/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,28 @@ class Config
attr_accessor :provider_name

def consumer_key(key = nil)
@consumer_key ||= key
unless key.nil?
@consumer_key = key
end
@consumer_key
end
alias_method :consumer_key=, :consumer_key

def consumer_secret(secret = nil)
@consumer_secret ||= secret
unless secret.nil?
@consumer_secret = secret
end
@consumer_secret
end
alias_method :consumer_secret=, :consumer_secret

def options(options = nil)
@options ||= options
unless options.nil?
@options = options
end
@options
end
alias_method :options=, :options

def check_requirements
if @consumer_key.nil? || @consumer_secret.nil?
Expand Down

0 comments on commit 24d0893

Please sign in to comment.