Sha256: c74146a2729733350c6efbc7de757e47e77d93bff990c63cf73ff9b09bd3b290

Contents?: true

Size: 652 Bytes

Versions: 12

Compression:

Stored size: 652 Bytes

Contents

module Yoda
  module Model
    module Descriptions
      class ValueDescription < Base
        # @return [Store::Objects::Base]
        attr_reader :value

        # @param value [Store::Objects::Base]
        def initialize(value)
          @value = value
        end

        # @return [String]
        def title
          "#{value.path}#{value.is_a?(Store::Objects::MetaClassObject) ? '.class' : ''}"
        end

        # @return [String]
        def sort_text
          value.name.to_s
        end

        def to_markdown
          <<~EOS
          **#{title}**

          #{value.document}
          EOS
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
yoda-language-server-0.10.1 lib/yoda/model/descriptions/value_description.rb
yoda-language-server-0.10.0 lib/yoda/model/descriptions/value_description.rb
yoda-language-server-0.9.0 lib/yoda/model/descriptions/value_description.rb
yoda-language-server-0.8.0 lib/yoda/model/descriptions/value_description.rb
yoda-language-server-0.7.2 lib/yoda/model/descriptions/value_description.rb
yoda-language-server-0.7.1 lib/yoda/model/descriptions/value_description.rb
yoda-language-server-0.7.0 lib/yoda/model/descriptions/value_description.rb
yoda-language-server-0.6.2 lib/yoda/model/descriptions/value_description.rb
yoda-language-server-0.6.1 lib/yoda/model/descriptions/value_description.rb
yoda-language-server-0.6.0 lib/yoda/model/descriptions/value_description.rb
yoda-language-server-0.5.0 lib/yoda/model/descriptions/value_description.rb
yoda-language-server-0.4.0 lib/yoda/model/descriptions/value_description.rb