Class: AWS::S3::FindResponseClass
- Inherits:
-
Object
- Object
- AWS::S3::FindResponseClass
- Defined in:
- lib/aws/s3/response.rb
Overview
Guess response class name from current class name. If the guessed response class doesn’t exist do the same thing to the current class’s parent class, up the inheritance heirarchy until either a response class is found or until we get to the top of the heirarchy in which case we just use the the Base response class.
Important: This implemantation assumes that the Base class has a corresponding Base::Response.
Class Method Summary collapse
Instance Method Summary collapse
- #find ⇒ Object
-
#initialize(start) ⇒ FindResponseClass
constructor
A new instance of FindResponseClass.
Constructor Details
#initialize(start) ⇒ FindResponseClass
Returns a new instance of FindResponseClass.
156 157 158 159 |
# File 'lib/aws/s3/response.rb', line 156 def initialize(start) @container = AWS::S3 @current_class = start end |
Class Method Details
.for(start) ⇒ Object
151 152 153 |
# File 'lib/aws/s3/response.rb', line 151 def for(start) new(start).find end |
Instance Method Details
#find ⇒ Object
161 162 163 164 |
# File 'lib/aws/s3/response.rb', line 161 def find self.current_class = current_class.superclass until response_class_found? target.const_get(class_to_find) end |