Class: GfreshPoint::RequestObjects::ConsumePointRequest
- Inherits:
-
RequestObject
- Object
- RequestObject
- GfreshPoint::RequestObjects::ConsumePointRequest
- Defined in:
- lib/gfresh_point/request_objects/consume_point_request.rb
Instance Attribute Summary collapse
-
#app_id ⇒ Object
Returns the value of attribute app_id.
-
#comment ⇒ Object
Returns the value of attribute comment.
-
#event_name ⇒ Object
Returns the value of attribute event_name.
-
#force ⇒ Object
Returns the value of attribute force.
-
#origin_id ⇒ Object
Returns the value of attribute origin_id.
-
#point ⇒ Object
Returns the value of attribute point.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
Instance Method Summary collapse
-
#initialize(app_id, user_id, point, event_name, origin_id, force, comment) ⇒ ConsumePointRequest
constructor
A new instance of ConsumePointRequest.
Methods inherited from RequestObject
#add_error, #errors, #has_errors, #success?
Constructor Details
#initialize(app_id, user_id, point, event_name, origin_id, force, comment) ⇒ ConsumePointRequest
Returns a new instance of ConsumePointRequest.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/gfresh_point/request_objects/consume_point_request.rb', line 6 def initialize(app_id, user_id, point, event_name, origin_id, force, comment) @app_id = app_id @user_id = user_id @point = point @event_name = event_name @origin_id = origin_id @comment = comment @force = force if app_id.blank? add_error('app_id', "App id can not be blank") end if user_id.blank? add_error('user_id', "User id can not be blank") end if point.blank? add_error('point', "point can not be blank") elsif point < 0 add_error('point', "point must larger than 0") end end |
Instance Attribute Details
#app_id ⇒ Object
Returns the value of attribute app_id.
4 5 6 |
# File 'lib/gfresh_point/request_objects/consume_point_request.rb', line 4 def app_id @app_id end |
#comment ⇒ Object
Returns the value of attribute comment.
4 5 6 |
# File 'lib/gfresh_point/request_objects/consume_point_request.rb', line 4 def comment @comment end |
#event_name ⇒ Object
Returns the value of attribute event_name.
4 5 6 |
# File 'lib/gfresh_point/request_objects/consume_point_request.rb', line 4 def event_name @event_name end |
#force ⇒ Object
Returns the value of attribute force.
4 5 6 |
# File 'lib/gfresh_point/request_objects/consume_point_request.rb', line 4 def force @force end |
#origin_id ⇒ Object
Returns the value of attribute origin_id.
4 5 6 |
# File 'lib/gfresh_point/request_objects/consume_point_request.rb', line 4 def origin_id @origin_id end |
#point ⇒ Object
Returns the value of attribute point.
4 5 6 |
# File 'lib/gfresh_point/request_objects/consume_point_request.rb', line 4 def point @point end |
#user_id ⇒ Object
Returns the value of attribute user_id.
4 5 6 |
# File 'lib/gfresh_point/request_objects/consume_point_request.rb', line 4 def user_id @user_id end |