Class: Transpec::Syntax::Have::HaveRecord

Inherits:
Record
  • Object
show all
Defined in:
lib/transpec/syntax/have/have_record.rb

Constant Summary

Constants inherited from Record

Record::OVERRIDDE_FORBIDDEN_METHODS

Instance Attribute Summary collapse

Attributes inherited from Record

#converted_syntax_type, #original_syntax_type

Instance Method Summary collapse

Methods inherited from Record

#==, #converted_syntax, #hash, #original_syntax, #to_s

Constructor Details

#initialize(have) ⇒ HaveRecord

Returns a new instance of HaveRecord.



11
12
13
# File 'lib/transpec/syntax/have/have_record.rb', line 11

def initialize(have)
  @have = have
end

Instance Attribute Details

#haveObject (readonly)

Returns the value of attribute have.



9
10
11
# File 'lib/transpec/syntax/have/have_record.rb', line 9

def have
  @have
end

Instance Method Details

#annotationObject



15
16
17
18
19
20
21
22
23
# File 'lib/transpec/syntax/have/have_record.rb', line 15

def annotation
  return @annotation if instance_variable_defined?(:@annotation)

  @annotation = if have.accurate_conversion?
                  nil
                else
                  AccuracyAnnotation.new(have.matcher_range)
                end
end