Class: GfreshPoint::RequestObjects::FetchUserPointsRequest

Inherits:
RequestObject
  • Object
show all
Defined in:
lib/gfresh_point/request_objects/fetch_user_points_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestObject

#add_error, #errors, #has_errors, #success?

Constructor Details

#initialize(app_id, user_id, event_names, origin_id) ⇒ FetchUserPointsRequest

Returns a new instance of FetchUserPointsRequest.



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/gfresh_point/request_objects/fetch_user_points_request.rb', line 6

def initialize(app_id, user_id, event_names, origin_id)
  @app_id = app_id
  @user_id = user_id
  @event_names = event_names
  @origin_id = origin_id

  if user_id.blank?
    add_error('user_id', "User id can not be blank")
  end
  if app_id.blank?
    add_error('app_id', "App id can not be blank")
  end
end

Instance Attribute Details

#app_idObject (readonly)

Returns the value of attribute app_id.



4
5
6
# File 'lib/gfresh_point/request_objects/fetch_user_points_request.rb', line 4

def app_id
  @app_id
end

#event_namesObject (readonly)

Returns the value of attribute event_names.



4
5
6
# File 'lib/gfresh_point/request_objects/fetch_user_points_request.rb', line 4

def event_names
  @event_names
end

#origin_idObject (readonly)

Returns the value of attribute origin_id.



4
5
6
# File 'lib/gfresh_point/request_objects/fetch_user_points_request.rb', line 4

def origin_id
  @origin_id
end

#user_idObject (readonly)

Returns the value of attribute user_id.



4
5
6
# File 'lib/gfresh_point/request_objects/fetch_user_points_request.rb', line 4

def user_id
  @user_id
end