Class: WinewooCore::Models::WinewooUserParams

Inherits:
Object
  • Object
show all
Defined in:
lib/winewoo_core/models/winewoo_user_params.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_tokenObject

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_agentObject

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

#getObject



18
19
20
# File 'lib/winewoo_core/models/winewoo_user_params.rb', line 18

def get
  return @params[:winewoo_user].blank? ? {} : permit_params
end