Class: HyperAdmin::DSL::Index
- Inherits:
-
Object
- Object
- HyperAdmin::DSL::Index
- Defined in:
- lib/hyper_admin/dsl/index.rb
Instance Method Summary collapse
- #column(attribute, type: infer_type(attribute), human: human_name(attribute)) ⇒ Object
-
#initialize(resource_class) ⇒ Index
constructor
A new instance of Index.
Constructor Details
#initialize(resource_class) ⇒ Index
Returns a new instance of Index.
5 6 7 8 |
# File 'lib/hyper_admin/dsl/index.rb', line 5 def initialize(resource_class) @resource_class = resource_class @columns = [] end |
Instance Method Details
#column(attribute, type: infer_type(attribute), human: human_name(attribute)) ⇒ Object
10 11 12 |
# File 'lib/hyper_admin/dsl/index.rb', line 10 def column(attribute, type: infer_type(attribute), human: human_name(attribute)) @columns << { attribute: attribute, type: type, human: human } end |