Class: Baidu::Push::Message
- Inherits:
-
Object
- Object
- Baidu::Push::Message
- Defined in:
- lib/baidu/push/message.rb
Instance Method Summary collapse
Instance Method Details
#messages=(msg = {}) ⇒ Object
136 137 138 139 140 141 142 143 144 145 146 147 148 |
# File 'lib/baidu/push/message.rb', line 136 def (msg = {}) = {} [:title] = msg[:title].to_s [:description] = msg[:description].to_s case device_type when 3 [:custom_content] = msg[:custom_content] when 4 [:aps] = msg[:aps] msg[:custom_content].each { |k, v| [k] = v } end super(.to_json) end |
#non_nil_attributes ⇒ Object
132 133 134 |
# File 'lib/baidu/push/message.rb', line 132 def non_nil_attributes attributes.reject { |_, v| v.nil? } end |