Class: JPush::WinphoneNotification
- Inherits:
-
Object
- Object
- JPush::WinphoneNotification
- Defined in:
- lib/jpush/model/notification/winphone_notification.rb
Instance Attribute Summary collapse
-
#_open_page ⇒ Object
Returns the value of attribute _open_page.
-
#alert ⇒ Object
Returns the value of attribute alert.
-
#extras ⇒ Object
Returns the value of attribute extras.
-
#title ⇒ Object
Returns the value of attribute title.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ WinphoneNotification
constructor
A new instance of WinphoneNotification.
- #toJSON ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ WinphoneNotification
Returns a new instance of WinphoneNotification.
4 5 6 7 8 9 |
# File 'lib/jpush/model/notification/winphone_notification.rb', line 4 def initialize(opts = {}) @alert = opts[:alert] @title = opts[:title] @_open_page = opts[:_open_page] @extras = opts[:extras] end |
Instance Attribute Details
#_open_page ⇒ Object
Returns the value of attribute _open_page.
3 4 5 |
# File 'lib/jpush/model/notification/winphone_notification.rb', line 3 def _open_page @_open_page end |
#alert ⇒ Object
Returns the value of attribute alert.
3 4 5 |
# File 'lib/jpush/model/notification/winphone_notification.rb', line 3 def alert @alert end |
#extras ⇒ Object
Returns the value of attribute extras.
3 4 5 |
# File 'lib/jpush/model/notification/winphone_notification.rb', line 3 def extras @extras end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/jpush/model/notification/winphone_notification.rb', line 3 def title @title end |
Class Method Details
.build(opts = {}) ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/jpush/model/notification/winphone_notification.rb', line 28 def self.build(opts = {}) winphone = JPush::WinphoneNotification.new(opts) if winphone.alert == nil raise ArgumentError.new('winphone the alert should be setted') end return winphone end |
Instance Method Details
#toJSON ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/jpush/model/notification/winphone_notification.rb', line 11 def toJSON array = {} if @alert != nil then array['alert'] = @alert end if @title != nil then array['title'] = @title end if @_open_page != nil then array['_open_page'] = @_open_page end if @extras != nil then array['extras'] = @extras end return array end |