Class: Asdawqw::PushNotificationLinksModel
- Defined in:
- lib/asdawqw/models/push_notification_links_model.rb
Overview
Model for push notification links
Instance Attribute Summary collapse
-
#async_push ⇒ String
Link for push data for async messages.
-
#book_link ⇒ String
Link for getting notifications about new reservations.
-
#cancel_link ⇒ String
Link for getting notification about cancel reservation.
-
#request_to_book ⇒ String
Link for request to book for AirBnb.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
Instance Method Summary collapse
-
#initialize(book_link = nil, cancel_link = nil, async_push = nil, request_to_book = nil) ⇒ PushNotificationLinksModel
constructor
A new instance of PushNotificationLinksModel.
Methods inherited from BaseModel
Constructor Details
#initialize(book_link = nil, cancel_link = nil, async_push = nil, request_to_book = nil) ⇒ PushNotificationLinksModel
Returns a new instance of PushNotificationLinksModel.
35 36 37 38 39 40 41 42 43 |
# File 'lib/asdawqw/models/push_notification_links_model.rb', line 35 def initialize(book_link = nil, cancel_link = nil, async_push = nil, request_to_book = nil) @book_link = book_link @cancel_link = cancel_link @async_push = async_push @request_to_book = request_to_book end |
Instance Attribute Details
#async_push ⇒ String
Link for push data for async messages
19 20 21 |
# File 'lib/asdawqw/models/push_notification_links_model.rb', line 19 def async_push @async_push end |
#book_link ⇒ String
Link for getting notifications about new reservations
11 12 13 |
# File 'lib/asdawqw/models/push_notification_links_model.rb', line 11 def book_link @book_link end |
#cancel_link ⇒ String
Link for getting notification about cancel reservation
15 16 17 |
# File 'lib/asdawqw/models/push_notification_links_model.rb', line 15 def cancel_link @cancel_link end |
#request_to_book ⇒ String
Link for request to book for AirBnb
23 24 25 |
# File 'lib/asdawqw/models/push_notification_links_model.rb', line 23 def request_to_book @request_to_book end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/asdawqw/models/push_notification_links_model.rb', line 46 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. book_link = hash['bookLink'] cancel_link = hash['cancelLink'] async_push = hash['asyncPush'] request_to_book = hash['requestToBook'] # Create object from extracted values. PushNotificationLinksModel.new(book_link, cancel_link, async_push, request_to_book) end |
.names ⇒ Object
A mapping from model property names to API property names.
26 27 28 29 30 31 32 33 |
# File 'lib/asdawqw/models/push_notification_links_model.rb', line 26 def self.names @_hash = {} if @_hash.nil? @_hash['book_link'] = 'bookLink' @_hash['cancel_link'] = 'cancelLink' @_hash['async_push'] = 'asyncPush' @_hash['request_to_book'] = 'requestToBook' @_hash end |