lib/sightstone/modules/summoner_module.rb
def summoner(name_or_id, optional={})
    region = optional[:region] || @sightstone.region
    uri = if name_or_id.is_a? Integer
      "https://prod.api.pvp.net/api/lol/#{region}/v1.3/summoner/#{name_or_id}"
    else
      "https://prod.api.pvp.net/api/lol/#{region}/v1.3/summoner/by-name/#{URI::encode(name_or_id)}"
    end
    
    response = _get_api_response(uri)
    _parse_response(response) { |resp|
      data = JSON.parse(resp)
      s = Summoner.new(data.values[0])
      if block_given?
        yield s
      else
        return s
      end
    }
  end
def summoner(name_or_id, optional={})
    region = optional[:region] || @sightstone.region
    uri = if name_or_id.is_a? Integer
      "https://prod.api.pvp.net/api/lol/#{region}/v1.3/summoner/#{name_or_id}"
    else
      "https://prod.api.pvp.net/api/lol/#{region}/v1.3/summoner/by-name/#{URI::encode(name_or_id)}"
    end
    
    response = _get_api_response(uri)
    _parse_response(response) { |resp|
      data = JSON.parse(resp)
      s = Summoner.new(data.values[0])
      if block_given?
        yield s
      else
        return s
      end
    }
  end
def summoner ( name_or_id , optional = { } ) region = optional [ :region ] || @sightstone . region uri = if name_or_id . is_a? Integer "https://prod.api.pvp.net/api/lol/#{region}/v1.3/summoner/#{name_or_id}" else "https://prod.api.pvp.net/api/lol/#{region}/v1.3/summoner/by-name/#{URI::encode(name_or_id)}" end response = _get_api_response ( uri ) _parse_response ( response ) { | resp | data = JSON . parse ( resp ) s = Summoner . new ( data . values [ 0 ] ) if block_given? yield s else return s end } end
returns a summoner object
 @param name_or_id [Integer, String] name or id of the summoner
 @param optional [Hash] optional arguments: :region => replaces default region
 @ return [Summoner] summoner
returns a summoner object