Class: PokeApi::LocationArea::EncounterMethodRate

Inherits:
Object
  • Object
show all
Includes:
AssignmentHelpers
Defined in:
lib/poke_api/location_area/encounter_method_rate.rb,
lib/poke_api/location_area/encounter_method_rate/encounter_version_detail.rb

Overview

EncounterMethodRate object handling encounter_method_rate data fetched from /location-area

Defined Under Namespace

Classes: EncounterVersionDetail

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from AssignmentHelpers

assign_list, custom_endpoint_object, endpoint_assignment, get_named_api_resource_from_url, try_to_assign

Constructor Details

#initialize(data) ⇒ EncounterMethodRate

Returns a new instance of EncounterMethodRate.



10
11
12
13
14
15
16
# File 'lib/poke_api/location_area/encounter_method_rate.rb', line 10

def initialize(data)
  @encounter_method = PokeApi::EncounterMethod.new(data[:encounter_method])
  @version_details  = assign_list(
    data: data[:version_details],
    klass: EncounterVersionDetail
  )
end

Instance Attribute Details

#encounter_methodObject (readonly)

Returns the value of attribute encounter_method.



7
8
9
# File 'lib/poke_api/location_area/encounter_method_rate.rb', line 7

def encounter_method
  @encounter_method
end

#version_detailsObject (readonly)

Returns the value of attribute version_details.



7
8
9
# File 'lib/poke_api/location_area/encounter_method_rate.rb', line 7

def version_details
  @version_details
end