Sha256: 18d38434ed1a5350cc64c5693aa281d069cce66e6a80bc77c941b4d5abf4b348
Contents?: true
Size: 597 Bytes
Versions: 18
Compression:
Stored size: 597 Bytes
Contents
# frozen_string_literal: true require "refinements/string" module Pennyworth module Loaders # Loads an array of text records. class Text using Refinements::String TRANSFORMS = %w[camelcase capitalize downcase size snakecase titleize upcase].freeze def initialize transforms: TRANSFORMS, model: Models::Text @transforms = transforms @model = model end def call content transforms.map { |kind| model[id: kind, content: content.public_send(kind)] } end private attr_reader :transforms, :model end end end
Version data entries
18 entries across 18 versions & 1 rubygems