Class: Ez::Resources::Manager::Field
- Inherits:
-
Object
- Object
- Ez::Resources::Manager::Field
- Defined in:
- lib/ez/resources/manager/field.rb
Instance Attribute Summary collapse
-
#builder ⇒ Object
readonly
Returns the value of attribute builder.
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
-
#default ⇒ Object
readonly
Returns the value of attribute default.
-
#getter ⇒ Object
readonly
Returns the value of attribute getter.
-
#min ⇒ Object
readonly
Returns the value of attribute min.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#presenter ⇒ Object
readonly
Returns the value of attribute presenter.
-
#required ⇒ Object
(also: #required?)
readonly
Returns the value of attribute required.
-
#search_label ⇒ Object
readonly
Returns the value of attribute search_label.
-
#search_suffix ⇒ Object
readonly
Returns the value of attribute search_suffix.
-
#searchable ⇒ Object
readonly
Returns the value of attribute searchable.
-
#sortable ⇒ Object
readonly
Returns the value of attribute sortable.
-
#suffix ⇒ Object
readonly
Returns the value of attribute suffix.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#wrapper ⇒ Object
readonly
Returns the value of attribute wrapper.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Field
constructor
A new instance of Field.
Constructor Details
#initialize(options = {}) ⇒ Field
Returns a new instance of Field.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/ez/resources/manager/field.rb', line 26 def initialize( = {}) @name = .delete(:name) @title = .delete(:title) || @name.to_s.capitalize @type = .delete(:type) || :string @required = .delete(:required) || true @collection = .delete(:collection) || [] @default = .delete(:default) @suffix = .delete(:suffix) @min = .delete(:min) @wrapper = .delete(:wrapper) @builder = .delete(:builder) @getter = .delete(:getter) @presenter = .delete(:presenter) @searchable = .delete(:searchable) != false @sortable = .delete(:sortable) || false @search_suffix = .delete(:search_suffix) || :cont @search_label = .delete(:search_label) @options = # use for all other custom options end |
Instance Attribute Details
#builder ⇒ Object (readonly)
Returns the value of attribute builder.
7 8 9 |
# File 'lib/ez/resources/manager/field.rb', line 7 def builder @builder end |
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
7 8 9 |
# File 'lib/ez/resources/manager/field.rb', line 7 def collection @collection end |
#default ⇒ Object (readonly)
Returns the value of attribute default.
7 8 9 |
# File 'lib/ez/resources/manager/field.rb', line 7 def default @default end |
#getter ⇒ Object (readonly)
Returns the value of attribute getter.
7 8 9 |
# File 'lib/ez/resources/manager/field.rb', line 7 def getter @getter end |
#min ⇒ Object (readonly)
Returns the value of attribute min.
7 8 9 |
# File 'lib/ez/resources/manager/field.rb', line 7 def min @min end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/ez/resources/manager/field.rb', line 7 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/ez/resources/manager/field.rb', line 7 def @options end |
#presenter ⇒ Object (readonly)
Returns the value of attribute presenter.
7 8 9 |
# File 'lib/ez/resources/manager/field.rb', line 7 def presenter @presenter end |
#required ⇒ Object (readonly) Also known as: required?
Returns the value of attribute required.
7 8 9 |
# File 'lib/ez/resources/manager/field.rb', line 7 def required @required end |
#search_label ⇒ Object (readonly)
Returns the value of attribute search_label.
7 8 9 |
# File 'lib/ez/resources/manager/field.rb', line 7 def search_label @search_label end |
#search_suffix ⇒ Object (readonly)
Returns the value of attribute search_suffix.
7 8 9 |
# File 'lib/ez/resources/manager/field.rb', line 7 def search_suffix @search_suffix end |
#searchable ⇒ Object (readonly)
Returns the value of attribute searchable.
7 8 9 |
# File 'lib/ez/resources/manager/field.rb', line 7 def searchable @searchable end |
#sortable ⇒ Object (readonly)
Returns the value of attribute sortable.
7 8 9 |
# File 'lib/ez/resources/manager/field.rb', line 7 def sortable @sortable end |
#suffix ⇒ Object (readonly)
Returns the value of attribute suffix.
7 8 9 |
# File 'lib/ez/resources/manager/field.rb', line 7 def suffix @suffix end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
7 8 9 |
# File 'lib/ez/resources/manager/field.rb', line 7 def title @title end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
7 8 9 |
# File 'lib/ez/resources/manager/field.rb', line 7 def type @type end |
#wrapper ⇒ Object (readonly)
Returns the value of attribute wrapper.
7 8 9 |
# File 'lib/ez/resources/manager/field.rb', line 7 def wrapper @wrapper end |