Sha256: dd984e17fe81a3afd4314d223f0ee028e6ace8a64f7caf0c499bed51bf96443b

Contents?: true

Size: 373 Bytes

Versions: 7

Compression:

Stored size: 373 Bytes

Contents

module Verbalize
  class BuildAttributeReaders
    def self.call(attributes: [])
      new(attributes: attributes).call
    end

    def initialize(attributes: [])
      @attributes = attributes
    end

    def call
      return '' if attributes.empty?
      "attr_reader #{attributes.map(&:inspect).join ', '}"
    end

    private

    attr_reader :attributes
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
verbalize-2.0.0 lib/verbalize/build_attribute_readers.rb
verbalize-1.4.1 lib/verbalize/build_attribute_readers.rb
verbalize-1.3.0 lib/verbalize/build_attribute_readers.rb
verbalize-1.2.0 lib/verbalize/build_attribute_readers.rb
verbalize-1.1.1 lib/verbalize/build_attribute_readers.rb
verbalize-1.0.1 lib/verbalize/build_attribute_readers.rb
verbalize-1.0.0 lib/verbalize/build_attribute_readers.rb