Class: VerifiedDouble::MethodSignature::Value
- Inherits:
-
Object
- Object
- VerifiedDouble::MethodSignature::Value
show all
- Defined in:
- lib/verified_double/method_signature/value.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(content) ⇒ Value
Returns a new instance of Value.
18
19
20
|
# File 'lib/verified_double/method_signature/value.rb', line 18
def initialize(content)
@content = content
end
|
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
4
5
6
|
# File 'lib/verified_double/method_signature/value.rb', line 4
def content
@content
end
|
Class Method Details
.from(content) ⇒ Object
6
7
8
9
10
11
12
13
14
15
16
|
# File 'lib/verified_double/method_signature/value.rb', line 6
def self.from(content)
if content == true || content == false
BooleanValue.new(content)
elsif content.respond_to?(:verified_instance_double?) && content.verified_instance_double?
RspecDoubleValue.new(content)
elsif content.is_a?(Module)
ClassValue.new(content)
else
InstanceValue.new(content)
end
end
|
Instance Method Details
#content_class ⇒ Object
22
23
24
|
# File 'lib/verified_double/method_signature/value.rb', line 22
def content_class
content.class
end
|
#recommended_value ⇒ Object
26
27
28
|
# File 'lib/verified_double/method_signature/value.rb', line 26
def recommended_value
MethodSignature::Value.from(self.content_class)
end
|