Class: ActiveDoc::Descriptions::MethodArgumentDescription::ArrayArgumentExpectation
- Inherits:
-
ArgumentExpectation
- Object
- ArgumentExpectation
- ActiveDoc::Descriptions::MethodArgumentDescription::ArrayArgumentExpectation
- 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) ⇒ ArrayArgumentExpectation
constructor
A new instance of ArrayArgumentExpectation.
- #to_rdoc ⇒ Object
Methods inherited from ArgumentExpectation
#additional_rdoc, find, #fulfilled?, inherited
Constructor Details
#initialize(argument) ⇒ ArrayArgumentExpectation
Returns a new instance of ArrayArgumentExpectation.
182 183 184 |
# File 'lib/active_doc/descriptions/method_argument_description.rb', line 182 def initialize(argument) @array = argument end |
Class Method Details
.from(argument, options, proc) ⇒ Object
200 201 202 203 204 |
# File 'lib/active_doc/descriptions/method_argument_description.rb', line 200 def self.from(argument, , proc) if argument.is_a? Array self.new(argument) end end |
Instance Method Details
#condition?(value, args_with_vals) ⇒ Boolean
186 187 188 |
# File 'lib/active_doc/descriptions/method_argument_description.rb', line 186 def condition?(value, args_with_vals) @array.include?(value) end |
#expectation_fail_to_s ⇒ Object
Expected to… NOTE: Possible thread-safe problem
192 193 194 |
# File 'lib/active_doc/descriptions/method_argument_description.rb', line 192 def expectation_fail_to_s "be included in #{@array.inspect}, got #{@failed_value.inspect}" end |
#to_rdoc ⇒ Object
196 197 198 |
# File 'lib/active_doc/descriptions/method_argument_description.rb', line 196 def to_rdoc @array.inspect end |