Class: ClAdmin::Resource::Field
- Inherits:
-
Object
- Object
- ClAdmin::Resource::Field
- Defined in:
- lib/cl_admin/resource/field.rb
Instance Attribute Summary collapse
-
#attribute ⇒ Object
readonly
Returns the value of attribute attribute.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #display_on_create? ⇒ Boolean
- #display_on_edit? ⇒ Boolean
- #display_on_index? ⇒ Boolean
- #display_on_show? ⇒ Boolean
-
#initialize(attribute:, name: nil, create: true, index: true, show: true, edit: true) ⇒ Field
constructor
A new instance of Field.
Constructor Details
#initialize(attribute:, name: nil, create: true, index: true, show: true, edit: true) ⇒ Field
Returns a new instance of Field.
6 7 8 9 10 11 12 13 |
# File 'lib/cl_admin/resource/field.rb', line 6 def initialize(attribute:, name: nil, create: true, index: true, show: true, edit: true) @attribute = attribute @name = name || attribute.titelize @create = create @index = index @show = show @edit = edit end |
Instance Attribute Details
#attribute ⇒ Object (readonly)
Returns the value of attribute attribute.
4 5 6 |
# File 'lib/cl_admin/resource/field.rb', line 4 def attribute @attribute end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/cl_admin/resource/field.rb', line 4 def name @name end |
Instance Method Details
#display_on_create? ⇒ Boolean
19 20 21 |
# File 'lib/cl_admin/resource/field.rb', line 19 def display_on_create? !!@create end |
#display_on_edit? ⇒ Boolean
27 28 29 |
# File 'lib/cl_admin/resource/field.rb', line 27 def display_on_edit? !!@edit end |
#display_on_index? ⇒ Boolean
15 16 17 |
# File 'lib/cl_admin/resource/field.rb', line 15 def display_on_index? !!@index end |
#display_on_show? ⇒ Boolean
23 24 25 |
# File 'lib/cl_admin/resource/field.rb', line 23 def display_on_show? !!@show end |