Class: ActiveAdmin::Scope
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#scope_block ⇒ Object
readonly
Returns the value of attribute scope_block.
-
#scope_method ⇒ Object
readonly
Returns the value of attribute scope_method.
Instance Method Summary collapse
-
#initialize(name, method = nil, &block) ⇒ Scope
constructor
A new instance of Scope.
Constructor Details
#initialize(name, method = nil, &block) ⇒ Scope
Returns a new instance of Scope.
6 7 8 9 10 11 12 13 14 |
# File 'lib/active_admin/scope.rb', line 6 def initialize(name, method = nil, &block) @name = name.to_s.titleize @scope_method = method || name.to_sym @id = @name.gsub(' ', '').underscore if block_given? @scope_method = nil @scope_block = block end end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/active_admin/scope.rb', line 4 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/active_admin/scope.rb', line 4 def name @name end |
#scope_block ⇒ Object (readonly)
Returns the value of attribute scope_block.
4 5 6 |
# File 'lib/active_admin/scope.rb', line 4 def scope_block @scope_block end |
#scope_method ⇒ Object (readonly)
Returns the value of attribute scope_method.
4 5 6 |
# File 'lib/active_admin/scope.rb', line 4 def scope_method @scope_method end |