Method: ProcessOut::Device#fill_with_data
- Defined in:
- lib/processout/device.rb
#fill_with_data(data) ⇒ Object
Fills the object with data coming from the API Params:
data-
Hashof data coming from the API
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/processout/device.rb', line 129 def fill_with_data(data) if data.nil? return self end if data.include? "request_origin" self.request_origin = data["request_origin"] end if data.include? "id" self.id = data["id"] end if data.include? "channel" self.channel = data["channel"] end if data.include? "ip_address" self.ip_address = data["ip_address"] end if data.include? "user_agent" self.user_agent = data["user_agent"] end if data.include? "header_accept" self.header_accept = data["header_accept"] end if data.include? "header_referer" self.header_referer = data["header_referer"] end if data.include? "app_color_depth" self.app_color_depth = data["app_color_depth"] end if data.include? "app_java_enabled" self.app_java_enabled = data["app_java_enabled"] end if data.include? "app_language" self.app_language = data["app_language"] end if data.include? "app_screen_height" self.app_screen_height = data["app_screen_height"] end if data.include? "app_screen_width" self.app_screen_width = data["app_screen_width"] end if data.include? "app_timezone_offset" self.app_timezone_offset = data["app_timezone_offset"] end self end |