Sha256: 3ccdb103316404baacd07494aa47be3021a27b7783792cc231fba4f71b8d046b

Contents?: true

Size: 577 Bytes

Versions: 11

Compression:

Stored size: 577 Bytes

Contents

# frozen_string_literal: true

module Bridgetown
  module Resource
    class TaxonomyTerm
      attr_reader :resource

      attr_reader :label

      attr_reader :type

      def initialize(resource:, label:, type:)
        @resource = resource
        @label = label
        @type = type
      end

      def to_liquid
        {
          "label" => label,
        }
      end
      alias_method :to_h, :to_liquid

      def as_json(*)
        to_h
      end

      ruby2_keywords def to_json(*options)
        as_json(*options).to_json(*options)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
bridgetown-core-0.21.5 lib/bridgetown-core/resource/taxonomy_term.rb
bridgetown-core-1.0.0.alpha1 lib/bridgetown-core/resource/taxonomy_term.rb
bridgetown-core-0.21.4 lib/bridgetown-core/resource/taxonomy_term.rb
bridgetown-core-0.21.3 lib/bridgetown-core/resource/taxonomy_term.rb
bridgetown-core-0.21.2 lib/bridgetown-core/resource/taxonomy_term.rb
bridgetown-core-0.21.1 lib/bridgetown-core/resource/taxonomy_term.rb
bridgetown-core-0.21.0 lib/bridgetown-core/resource/taxonomy_term.rb
bridgetown-core-0.21.0.beta4 lib/bridgetown-core/resource/taxonomy_term.rb
bridgetown-core-0.21.0.beta3 lib/bridgetown-core/resource/taxonomy_term.rb
bridgetown-core-0.21.0.beta2 lib/bridgetown-core/resource/taxonomy_term.rb
bridgetown-core-0.21.0.beta1 lib/bridgetown-core/resource/taxonomy_term.rb