Sha256: 44b72d2e1f1808ad58decd7a5cbba33fbba5f4623f4aaaca4c0ed30f344288c0

Contents?: true

Size: 801 Bytes

Versions: 3

Compression:

Stored size: 801 Bytes

Contents

# frozen_string_literal: true

require 'forwardable'

module EveOnline
  module ESI
    class DogmaAttribute < Base
      extend Forwardable

      API_ENDPOINT = 'https://esi.evetech.net/v1/dogma/attributes/%<attribute_id>s/?datasource=%<datasource>s'

      attr_reader :id

      def initialize(options)
        super

        @id = options.fetch(:id)
      end

      def_delegators :model, :as_json, :attribute_id, :default_value,
                     :description, :display_name, :high_is_good, :icon_id,
                     :name, :published, :stackable, :unit_id

      def model
        Models::DogmaAttribute.new(response)
      end
      memoize :model

      def scope; end

      def url
        format(API_ENDPOINT, attribute_id: id, datasource: datasource)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
eve_online-0.20.0 lib/eve_online/esi/dogma_attribute.rb
eve_online-0.19.0 lib/eve_online/esi/dogma_attribute.rb
eve_online-0.18.0 lib/eve_online/esi/dogma_attribute.rb