Sha256: 7e542e7db8100da9f96738ccf074ec1be315858f56e6b570e0c7a2dd666595aa

Contents?: true

Size: 1.54 KB

Versions: 2

Compression:

Stored size: 1.54 KB

Contents

class AuthResponse
  attr_accessor :device_id, :user_id, :result, :success, :error

  # :internal => :external
  def self.attribute_map
  {
      :device_id => :device_id, :user_id => :user_id, :result => :result, :success => :success, :error => :error

  }
  end

  def initialize(attributes = {})
    # Morph attribute keys into undescored rubyish style
    if attributes.to_s != ""

      if AuthResponse.attribute_map["device_id".to_sym] != nil
        name = "device_id".to_sym
        value = attributes["device_id"]
        send("#{name}=", value) if self.respond_to?(name)
	      end
      if AuthResponse.attribute_map["user_id".to_sym] != nil
        name = "user_id".to_sym
        value = attributes["user_id"]
        send("#{name}=", value) if self.respond_to?(name)
	      end
      if AuthResponse.attribute_map["result".to_sym] != nil
        name = "result".to_sym
        value = attributes["result"]
        send("#{name}=", value) if self.respond_to?(name)
	      end
      if AuthResponse.attribute_map["success".to_sym] != nil
        name = "success".to_sym
        value = attributes["success"]
        send("#{name}=", value) if self.respond_to?(name)
	      end
      if AuthResponse.attribute_map["error".to_sym] != nil
        name = "error".to_sym
        value = attributes["error"]
        send("#{name}=", value) if self.respond_to?(name)
	      end
      end
  end

  def to_body
    body = {}
    AuthResponse.attribute_map.each_pair do |key,value|
      body[value] = self.send(key) unless self.send(key).nil?
    end
    body
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
subtledata-0.0.5 models/authresponse.rb
subtledata-0.0.3 models/authresponse.rb