rdavid1099/poke-api-v2

View on GitHub
lib/poke_api/common/flavor_text.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
module PokeApi
  module Common
    # FlavorText object handling lists of FlavorText
    class FlavorText
      include AssignmentHelpers

      attr_reader :flavor_text,
                  :language,
                  :version

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