class Bnet::BnetResource

Constants

PARAMS_MAPPING

Public Class Methods

from_api(raw_response) click to toggle source
# File lib/bnet/bnet_resource.rb, line 11
def self.from_api(raw_response)
  new_hash = {}
  params_mapping.each do |old_key, new_key|
    if raw_response.has_key?(old_key)
      new_hash[new_key] = raw_response[old_key]
    end
  end

  bnet_resource = self.new(new_hash)
end
new(args = {}) click to toggle source
# File lib/bnet/bnet_resource.rb, line 5
def initialize args = {}
  args.each do |k,v|
    instance_variable_set("@#{k}", v) unless v.nil?
  end
end

Private Class Methods

params_mapping() click to toggle source
# File lib/bnet/bnet_resource.rb, line 24
def self.params_mapping
  self::PARAMS_MAPPING
end