Class: Socialmux::Strategy
- Inherits:
-
Object
- Object
- Socialmux::Strategy
- Defined in:
- lib/socialmux/strategy.rb
Instance Attribute Summary collapse
-
#adapter ⇒ Object
readonly
Returns the value of attribute adapter.
-
#current_user ⇒ Object
readonly
Returns the value of attribute current_user.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#user_params ⇒ Object
readonly
Returns the value of attribute user_params.
Instance Method Summary collapse
-
#initialize(options) ⇒ Strategy
constructor
A new instance of Strategy.
- #result ⇒ Object
Constructor Details
#initialize(options) ⇒ Strategy
Returns a new instance of Strategy.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/socialmux/strategy.rb', line 11 def initialize() .assert_valid_keys(:adapter, :current_user, :data, :user_params) .each do |key, value| instance_variable_set "@#{key}", value end end |
Instance Attribute Details
#adapter ⇒ Object (readonly)
Returns the value of attribute adapter.
6 7 8 |
# File 'lib/socialmux/strategy.rb', line 6 def adapter @adapter end |
#current_user ⇒ Object (readonly)
Returns the value of attribute current_user.
7 8 9 |
# File 'lib/socialmux/strategy.rb', line 7 def current_user @current_user end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
8 9 10 |
# File 'lib/socialmux/strategy.rb', line 8 def data @data end |
#user_params ⇒ Object (readonly)
Returns the value of attribute user_params.
9 10 11 |
# File 'lib/socialmux/strategy.rb', line 9 def user_params @user_params end |
Instance Method Details
#result ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/socialmux/strategy.rb', line 22 def result authentication_already_taken || returning_user || augmented_current_user || augmented_user_with_same_email || new_user end |