Sha256: ab4175a7f2970d9d33116ef7e1741101e0ec6c9064a6af3b9038d0a81a0e4ed0

Contents?: true

Size: 481 Bytes

Versions: 11

Compression:

Stored size: 481 Bytes

Contents

# frozen_string_literal: true

module Bridgetown
  # TODO: to be retired once the Resource engine is made official
  module DataAccessible
    # Returns the contents as a String.
    def to_s
      output || content || ""
    end

    # Accessor for data properties by Liquid.
    #
    # property - The String name of the property to retrieve.
    #
    # Returns the String value or nil if the property isn't included.
    def [](property)
      data[property]
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
bridgetown-core-0.21.5 lib/bridgetown-core/concerns/data_accessible.rb
bridgetown-core-0.21.4 lib/bridgetown-core/concerns/data_accessible.rb
bridgetown-core-0.21.3 lib/bridgetown-core/concerns/data_accessible.rb
bridgetown-core-0.21.2 lib/bridgetown-core/concerns/data_accessible.rb
bridgetown-core-0.21.1 lib/bridgetown-core/concerns/data_accessible.rb
bridgetown-core-0.21.0 lib/bridgetown-core/concerns/data_accessible.rb
bridgetown-core-0.21.0.beta4 lib/bridgetown-core/concerns/data_accessible.rb
bridgetown-core-0.21.0.beta3 lib/bridgetown-core/concerns/data_accessible.rb
bridgetown-core-0.21.0.beta2 lib/bridgetown-core/concerns/data_accessible.rb
bridgetown-core-0.21.0.beta1 lib/bridgetown-core/concerns/data_accessible.rb
bridgetown-core-0.20.0 lib/bridgetown-core/concerns/data_accessible.rb