Class: Widgets::UserRequest::Main
- Inherits:
-
Object
- Object
- Widgets::UserRequest::Main
- Includes:
- ActiveModel::Validations
- Defined in:
- app/my_lib/widgets/user_request/main.rb
Overview
Main class of Offering Booking Assistance Logic
Instance Attribute Summary collapse
-
#date ⇒ Object
Returns the value of attribute date.
-
#message ⇒ Object
Returns the value of attribute message.
-
#name ⇒ Object
Returns the value of attribute name.
-
#party_size ⇒ Object
Returns the value of attribute party_size.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#restaurant_id ⇒ Object
Returns the value of attribute restaurant_id.
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
- #error_message ⇒ Object
- #execute ⇒ Object
-
#initialize(params = {}) ⇒ Main
constructor
A new instance of Main.
Constructor Details
#initialize(params = {}) ⇒ Main
Returns a new instance of Main.
19 20 21 22 23 |
# File 'app/my_lib/widgets/user_request/main.rb', line 19 def initialize(params = {}) params.each_pair do |key, value| send("#{key}=".to_sym, value) if respond_to?("#{key}=".to_sym) end end |
Instance Attribute Details
#date ⇒ Object
Returns the value of attribute date.
10 11 12 |
# File 'app/my_lib/widgets/user_request/main.rb', line 10 def date @date end |
#message ⇒ Object
Returns the value of attribute message.
10 11 12 |
# File 'app/my_lib/widgets/user_request/main.rb', line 10 def @message end |
#name ⇒ Object
Returns the value of attribute name.
10 11 12 |
# File 'app/my_lib/widgets/user_request/main.rb', line 10 def name @name end |
#party_size ⇒ Object
Returns the value of attribute party_size.
10 11 12 |
# File 'app/my_lib/widgets/user_request/main.rb', line 10 def party_size @party_size end |
#phone ⇒ Object
Returns the value of attribute phone.
10 11 12 |
# File 'app/my_lib/widgets/user_request/main.rb', line 10 def phone @phone end |
#restaurant_id ⇒ Object
Returns the value of attribute restaurant_id.
10 11 12 |
# File 'app/my_lib/widgets/user_request/main.rb', line 10 def restaurant_id @restaurant_id end |
#time ⇒ Object
Returns the value of attribute time.
10 11 12 |
# File 'app/my_lib/widgets/user_request/main.rb', line 10 def time @time end |
Instance Method Details
#error_message ⇒ Object
25 26 27 |
# File 'app/my_lib/widgets/user_request/main.rb', line 25 def errors.blank? ? nil : errors..to_sentence end |
#execute ⇒ Object
29 30 31 32 |
# File 'app/my_lib/widgets/user_request/main.rb', line 29 def execute return false unless valid? ::UserRequestWorker.perform_async(worker_payload) end |