Class: Arcane::Finder
- Inherits:
-
Object
- Object
- Arcane::Finder
- Defined in:
- lib/arcane/finder.rb
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(object) ⇒ Finder
constructor
A new instance of Finder.
- #refinery ⇒ Object
Constructor Details
#initialize(object) ⇒ Finder
Returns a new instance of Finder.
7 8 9 |
# File 'lib/arcane/finder.rb', line 7 def initialize(object) @object = object end |
Instance Attribute Details
#object ⇒ Object (readonly)
Returns the value of attribute object.
5 6 7 |
# File 'lib/arcane/finder.rb', line 5 def object @object end |
Class Method Details
.object_name(object) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/arcane/finder.rb', line 19 def self.object_name(object) klass = if object.respond_to?(:model_name) object.model_name elsif object.class.respond_to?(:model_name) object.class.model_name elsif object.is_a?(Class) object else object.class end klass.to_s end |