Class: Administrate::Field::Deferred
- Inherits:
-
Object
- Object
- Administrate::Field::Deferred
- Defined in:
- lib/administrate/field/deferred.rb
Instance Attribute Summary collapse
-
#deferred_class ⇒ Object
readonly
Returns the value of attribute deferred_class.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(deferred_class, options = {}) ⇒ Deferred
constructor
A new instance of Deferred.
- #new(*args) ⇒ Object
- #permitted_attribute(attr, _options = nil) ⇒ Object
- #searchable? ⇒ Boolean
- #searchable_field ⇒ Object
Constructor Details
#initialize(deferred_class, options = {}) ⇒ Deferred
Returns a new instance of Deferred.
6 7 8 9 |
# File 'lib/administrate/field/deferred.rb', line 6 def initialize(deferred_class, = {}) @deferred_class = deferred_class @options = end |
Instance Attribute Details
#deferred_class ⇒ Object (readonly)
Returns the value of attribute deferred_class.
11 12 13 |
# File 'lib/administrate/field/deferred.rb', line 11 def deferred_class @deferred_class end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
11 12 13 |
# File 'lib/administrate/field/deferred.rb', line 11 def @options end |
Instance Method Details
#==(other) ⇒ Object
18 19 20 21 22 |
# File 'lib/administrate/field/deferred.rb', line 18 def ==(other) other.respond_to?(:deferred_class) && deferred_class == other.deferred_class && == other. end |
#new(*args) ⇒ Object
13 14 15 16 |
# File 'lib/administrate/field/deferred.rb', line 13 def new(*args) = args.last.respond_to?(:merge) ? args.pop : {} deferred_class.new(*args, .merge()) end |
#permitted_attribute(attr, _options = nil) ⇒ Object
32 33 34 35 |
# File 'lib/administrate/field/deferred.rb', line 32 def permitted_attribute(attr, = nil) .fetch(:foreign_key, deferred_class.permitted_attribute(attr, )) end |
#searchable? ⇒ Boolean
24 25 26 |
# File 'lib/administrate/field/deferred.rb', line 24 def searchable? .fetch(:searchable, deferred_class.searchable?) end |
#searchable_field ⇒ Object
28 29 30 |
# File 'lib/administrate/field/deferred.rb', line 28 def searchable_field .fetch(:searchable_field) end |