Sha256: a75109d16a504ca76af9f9310d31e387f57cf3ebf0aaf75c44608b2a8788a995
Contents?: true
Size: 482 Bytes
Versions: 24
Compression:
Stored size: 482 Bytes
Contents
# frozen_string_literal: true module SirTrevorRails module Blocks ## # Mixin for blocks that display text module Displayable def items item_values.select { |x| x[:display] == 'true' } end def item_ids items.pluck(:id) end def ordered_items items.sort_by { |x| x[:weight].to_i }.pluck(:id) end private def item_values Array((item.values if item.present?)) end end end end
Version data entries
24 entries across 24 versions & 1 rubygems