Sha256: caeaf984e13acc32bc5f7d30e5e548c44a5bd9b4b57721be3cae68ff341040da

Contents?: true

Size: 1.16 KB

Versions: 1

Compression:

Stored size: 1.16 KB

Contents

module Falsify
  # Information about the browser that the customer used when they placed their order.
  class ClientDetails
    # The languages and locales that the browser understands.
    # @return [String]
    attr_accessor :accept_language
    # The browser screen height in pixels, if available.
    # @return [Integer]
    attr_accessor :browser_height
    # The browser IP address.
    # @return [String]
    attr_accessor :browser_ip
    # The browser screen width in pixels, if available.
    # @return [Integer]
    attr_accessor :browser_width
    # A hash of the session.
    # @return [String]
    attr_accessor :session_hash
    # Details of the browsing client, including software and operating versions.
    # @return [String]
    attr_accessor :user_agent

    # @param hash [Hash]
    # @return [ClientDetails]
    def create_from_hash(hash)
      cd = ClientDetails.new
      cd.accept_language = hash[:accept_language]
      cd.browser_height = hash[:browser_height]
      cd.browser_ip = hash[:browser_ip]
      cd.browser_width = hash[:browser_width]
      cd.session_hash = hash[:session_hash]
      cd.user_agent = hash[:user_agent]
      return cd
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
falsify-0.1.0 lib/falsify/models/order/client_details.rb