Sha256: 3f622506517b1b903ab264aeb0eba6aa9897192f4488a3a4b6de54ebfc324479

Contents?: true

Size: 554 Bytes

Versions: 1

Compression:

Stored size: 554 Bytes

Contents

module HyperAdmin
  class Resource
    attr_reader :resource_class, :config

    def initialize(resource_class, config)
      @resource_class = resource_class
      @config = config
    end

    def resource_name
      @resource_class.model_name
    end

    def controller_name
      "#{resource_name.plural.camelize}Controller"
    end

    def show_config
      @config[:show_config] if @config
    end

    def index_config
      @config[:index_config] if @config
    end

    def form_config
      @config[:form_config] if @config
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hyper_admin-0.4.0 lib/hyper_admin/resource.rb