Sha256: a1a89bbeb2a5f92c9fd8d318c45b0f4f27d7403f838b4bca32b628b56c18bbce

Contents?: true

Size: 810 Bytes

Versions: 6

Compression:

Stored size: 810 Bytes

Contents

# -*- encoding : utf-8 -*-
module RademadeAdmin
  module ModelOptions

    # Configure admin part of model
    # Support options
    #  - model
    #  - name
    #  - parent_menu (todo extract to menu method)
    #  - menu_count
    #  - list
    #  - form
    #  - labels
    #
    def options(&options_block)
      configuration.instance_eval &options_block
    end

    def model_name
      configuration.model_name
    end

    def item_name
      configuration.item_name
    end

    def parent_menu_item
      configuration.parent_menu_item
    end

    def model_class
      configuration.model_class
    end

    def model_info
      @model_info ||= Model::Graph.instance.model_info(model_class)
    end

    def configuration
      @configuration ||= Model::Configuration.new(self)
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rademade_admin-0.2.2 app/services/model_controller/model_options.rb
rademade_admin-0.2.1 app/services/model_controller/model_options.rb
rademade_admin-0.2.0 app/services/model_controller/model_options.rb
rademade_admin-0.1.6 app/services/model_controller/model_options.rb
rademade_admin-0.1.5 app/services/model_controller/model_options.rb
rademade_admin-0.1.4 app/services/model_controller/model_options.rb