Class: PokeApi::Common::FlavorText

Inherits:
Object
  • Object
show all
Includes:
AssignmentHelpers
Defined in:
lib/poke_api/common/flavor_text.rb

Overview

FlavorText object handling lists of FlavorText

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) ⇒ FlavorText

Returns a new instance of FlavorText.



11
12
13
14
15
# File 'lib/poke_api/common/flavor_text.rb', line 11

def initialize(data)
  @flavor_text = data[:flavor_text]
  @language = Utility::Language.new(data[:language])
  @version = try_to_assign(data: data[:version], klass: Version)
end

Instance Attribute Details

#flavor_textObject (readonly)

Returns the value of attribute flavor_text.



7
8
9
# File 'lib/poke_api/common/flavor_text.rb', line 7

def flavor_text
  @flavor_text
end

#languageObject (readonly)

Returns the value of attribute language.



7
8
9
# File 'lib/poke_api/common/flavor_text.rb', line 7

def language
  @language
end

#versionObject (readonly)

Returns the value of attribute version.



7
8
9
# File 'lib/poke_api/common/flavor_text.rb', line 7

def version
  @version
end