Class: WinewooCore::Models::WinewooUserParams
- Inherits:
-
Object
- Object
- WinewooCore::Models::WinewooUserParams
- Defined in:
- lib/winewoo_core/models/winewoo_user_params.rb
Instance Attribute Summary collapse
-
#device_push_token ⇒ Object
Returns the value of attribute device_push_token.
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
Instance Method Summary collapse
- #get ⇒ Object
-
#initialize(params, user_agent) ⇒ WinewooUserParams
constructor
A new instance of WinewooUserParams.
Constructor Details
#initialize(params, user_agent) ⇒ WinewooUserParams
Returns a new instance of WinewooUserParams.
7 8 9 10 11 12 13 14 15 |
# File 'lib/winewoo_core/models/winewoo_user_params.rb', line 7 def initialize(params, user_agent) @params = params @user_agent = user_agent @device_push_token = @params[:device_push_token] || (@params[:winewoo_user_device] && @params[:winewoo_user_device][:device_push_token]) if @params[:avatar] @params[:winewoo_user] ||= {} @params[:winewoo_user][:avatar] = @params[:avatar] end end |
Instance Attribute Details
#device_push_token ⇒ Object
Returns the value of attribute device_push_token.
5 6 7 |
# File 'lib/winewoo_core/models/winewoo_user_params.rb', line 5 def device_push_token @device_push_token end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
4 5 6 |
# File 'lib/winewoo_core/models/winewoo_user_params.rb', line 4 def user_agent @user_agent end |
Instance Method Details
#get ⇒ Object
18 19 20 |
# File 'lib/winewoo_core/models/winewoo_user_params.rb', line 18 def get return @params[:winewoo_user].blank? ? {} : permit_params end |