Class: ActiveDoc::Descriptions::MethodArgumentDescription::TypeArgumentExpectation
- Inherits:
-
ArgumentExpectation
- Object
- ArgumentExpectation
- ActiveDoc::Descriptions::MethodArgumentDescription::TypeArgumentExpectation
- Defined in:
- lib/active_doc/descriptions/method_argument_description.rb
Class Method Summary collapse
Instance Method Summary collapse
- #condition?(value, args_with_vals) ⇒ Boolean
-
#expectation_fail_to_s ⇒ Object
Expected to…
-
#initialize(argument) ⇒ TypeArgumentExpectation
constructor
A new instance of TypeArgumentExpectation.
- #to_rdoc ⇒ Object
Methods inherited from ArgumentExpectation
#additional_rdoc, find, #fulfilled?, inherited
Constructor Details
#initialize(argument) ⇒ TypeArgumentExpectation
Returns a new instance of TypeArgumentExpectation.
131 132 133 |
# File 'lib/active_doc/descriptions/method_argument_description.rb', line 131 def initialize(argument) @type = argument end |
Class Method Details
.from(argument, options, proc) ⇒ Object
148 149 150 151 152 |
# File 'lib/active_doc/descriptions/method_argument_description.rb', line 148 def self.from(argument, , proc) if argument.is_a?(Class) && proc.nil? self.new(argument) end end |
Instance Method Details
#condition?(value, args_with_vals) ⇒ Boolean
135 136 137 |
# File 'lib/active_doc/descriptions/method_argument_description.rb', line 135 def condition?(value, args_with_vals) value.is_a? @type end |
#expectation_fail_to_s ⇒ Object
Expected to…
140 141 142 |
# File 'lib/active_doc/descriptions/method_argument_description.rb', line 140 def expectation_fail_to_s "be #{@type.name}, got #{@failed_value.class.name}" end |
#to_rdoc ⇒ Object
144 145 146 |
# File 'lib/active_doc/descriptions/method_argument_description.rb', line 144 def to_rdoc @type.name end |