Sha256: be101d8785cd0c7c3b5d8ab1721ced280688770320c54bc6b4914a7b4d44fc5e

Contents?: true

Size: 767 Bytes

Versions: 3

Compression:

Stored size: 767 Bytes

Contents

# frozen_string_literal: true

module RespondForHelper
  class Config
    class_attribute :data

    self.data = {
      flash: RespondForHelper::Flashes::Timestamp,
      formats: {
        html: RespondForHelper::Formats::Html,
        json: RespondForHelper::Formats::Json
      },
      default_behaviours: {
        template: {},
        location: {},
        failure_template: { create: :new, update: :edit, destroy: :show, _default: :show },
        failure_location: { _default: :show }
      },
      member_actions: [:show, :edit, :update, :destroy]
    }

    data.keys.each do |key|
      define_singleton_method "#{key}" do
        data[key]
      end

      define_singleton_method "#{key}=" do |val|
        data[key] = val
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
respond_for_helper-1.0.2 lib/respond_for_helper/config.rb
respond_for_helper-1.0.1 lib/respond_for_helper/config.rb
respond_for_helper-1.0.0 lib/respond_for_helper/config.rb