Class: Brainstem::ApiDocs::Resolver
- Inherits:
-
Object
- Object
- Brainstem::ApiDocs::Resolver
- Includes:
- Concerns::Optional
- Defined in:
- lib/brainstem/api_docs/resolver.rb
Instance Attribute Summary collapse
-
#atlas ⇒ Object
Returns the value of attribute atlas.
-
#presenter_constant_lookup_method ⇒ Object
writeonly
Sets the attribute presenter_constant_lookup_method.
Instance Method Summary collapse
- #find_by_class(klass) ⇒ Object
-
#initialize(atlas, options = {}) ⇒ Resolver
constructor
A new instance of Resolver.
- #valid_options ⇒ Object
Constructor Details
#initialize(atlas, options = {}) ⇒ Resolver
Returns a new instance of Resolver.
22 23 24 25 |
# File 'lib/brainstem/api_docs/resolver.rb', line 22 def initialize(atlas, = {}) self.atlas = atlas super end |
Instance Attribute Details
#atlas ⇒ Object
Returns the value of attribute atlas.
28 29 30 |
# File 'lib/brainstem/api_docs/resolver.rb', line 28 def atlas @atlas end |
#presenter_constant_lookup_method=(value) ⇒ Object
Sets the attribute presenter_constant_lookup_method
28 29 30 |
# File 'lib/brainstem/api_docs/resolver.rb', line 28 def presenter_constant_lookup_method=(value) @presenter_constant_lookup_method = value end |
Instance Method Details
#find_by_class(klass) ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/brainstem/api_docs/resolver.rb', line 32 def find_by_class(klass) if klass == :polymorphic nil elsif klass < ActiveRecord::Base find_presenter_from_target_class(klass) end end |
#valid_options ⇒ Object
16 17 18 19 20 |
# File 'lib/brainstem/api_docs/resolver.rb', line 16 def [ :presenter_constant_lookup_method, ] end |