Sha256: 0bb293c75d525e5f568e008cd8021dc87a6a353647e3dfabb29be0d9ec67b518

Contents?: true

Size: 332 Bytes

Versions: 6

Compression:

Stored size: 332 Bytes

Contents

module Yaks
  class Resource
    module HasFields
      def map_fields(&block)
        with(
          fields: fields.map do |field|
            if field.type.equal? :fieldset
              field.map_fields(&block)
            else
              block.call(field)
            end
          end
        )
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
yaks-0.9.0 lib/yaks/resource/has_fields.rb
yaks-0.8.3 lib/yaks/resource/has_fields.rb
yaks-0.8.2 lib/yaks/resource/has_fields.rb
yaks-0.8.1 lib/yaks/resource/has_fields.rb
yaks-0.8.0 lib/yaks/resource/has_fields.rb
yaks-0.8.0.beta2 lib/yaks/resource/has_fields.rb