Sha256: 88f9c802482a9ac674f8120ea37365e652f7c865b3dbc646a8b6fb7222a5a6a6
Contents?: true
Size: 599 Bytes
Versions: 43
Compression:
Stored size: 599 Bytes
Contents
# frozen_string_literal: true require "refinements/strings" module Pennyworth module Loaders # Loads an array of text records. class Text using Refinements::Strings 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
43 entries across 43 versions & 1 rubygems