Sha256: fc01533ad1f8c8b393471e0f1120d039e0407bdd685597597de73d297cc27ba2

Contents?: true

Size: 1.27 KB

Versions: 25

Compression:

Stored size: 1.27 KB

Contents

# frozen_string_literal: true

require "forwardable"

module PlatformosCheck
  module PlatformosLiquid
    class SourceIndex
      class BaseEntry
        extend Forwardable

        attr_reader :hash

        def_delegators :return_type_instance, :generic_type?, :array_type?, :array_type, :to_s, :denied_filters

        PLATFORMOS_DOCUMENTATION_URL = "https://documentation.platformos.com"

        def initialize(hash = {})
          @hash = hash || {}
          @return_type = nil
        end

        def name
          hash['name']
        end

        def summary
          hash['summary'] || ''
        end

        def description
          hash['description'] || ''
        end

        def deprecated?
          hash['deprecated']
        end

        def deprecation_reason
          return nil unless deprecated?

          hash['deprecation_reason'] || nil
        end

        def platformos_documentation_url
          PLATFORMOS_DOCUMENTATION_URL
        end

        attr_writer :return_type

        def return_type
          @return_type || to_s
        end

        def return_type_instance
          ReturnTypeEntry.new(return_type_hash)
        end

        private

        def return_type_hash
          hash['return_type']&.first
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
platformos-check-0.4.14 lib/platformos_check/platformos_liquid/source_index/base_entry.rb
platformos-check-0.4.13 lib/platformos_check/platformos_liquid/source_index/base_entry.rb
platformos-check-0.4.12 lib/platformos_check/platformos_liquid/source_index/base_entry.rb
platformos-check-0.4.11 lib/platformos_check/platformos_liquid/source_index/base_entry.rb
platformos-check-0.4.10 lib/platformos_check/platformos_liquid/source_index/base_entry.rb
platformos-check-0.4.9 lib/platformos_check/platformos_liquid/source_index/base_entry.rb
platformos-check-0.4.8 lib/platformos_check/platformos_liquid/source_index/base_entry.rb
platformos-check-0.4.7 lib/platformos_check/platformos_liquid/source_index/base_entry.rb
platformos-check-0.4.6 lib/platformos_check/platformos_liquid/source_index/base_entry.rb
platformos-check-0.4.5 lib/platformos_check/platformos_liquid/source_index/base_entry.rb
platformos-check-0.4.4 lib/platformos_check/platformos_liquid/source_index/base_entry.rb
platformos-check-0.4.3 lib/platformos_check/platformos_liquid/source_index/base_entry.rb
platformos-check-0.4.2 lib/platformos_check/platformos_liquid/source_index/base_entry.rb
platformos-check-0.4.1 lib/platformos_check/platformos_liquid/source_index/base_entry.rb
platformos-check-0.4.0 lib/platformos_check/platformos_liquid/source_index/base_entry.rb
platformos-check-0.3.3 lib/platformos_check/platformos_liquid/source_index/base_entry.rb
platformos-check-0.3.1 lib/platformos_check/platformos_liquid/source_index/base_entry.rb
platformos-check-0.3.0 lib/platformos_check/platformos_liquid/source_index/base_entry.rb
platformos-check-0.2.2 lib/platformos_check/platformos_liquid/source_index/base_entry.rb
platformos-check-0.2.1 lib/platformos_check/platformos_liquid/source_index/base_entry.rb