Class: Transpec::Syntax::Mixin::AnyInstanceBlock::RecordBuilder

Inherits:
RecordBuilder
  • Object
show all
Defined in:
lib/transpec/syntax/mixin/any_instance_block.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RecordBuilder

build, #build

Constructor Details

#initialize(host) ⇒ RecordBuilder

Returns a new instance of RecordBuilder.



42
43
44
# File 'lib/transpec/syntax/mixin/any_instance_block.rb', line 42

def initialize(host)
  @host = host
end

Instance Attribute Details

#host ⇒ Object (readonly)

Returns the value of attribute host.



40
41
42
# File 'lib/transpec/syntax/mixin/any_instance_block.rb', line 40

def host
  @host
end

Instance Method Details

#base_syntax ⇒ Object



54
55
56
# File 'lib/transpec/syntax/mixin/any_instance_block.rb', line 54

def base_syntax
  fail NotImplementedError
end

#new_syntax ⇒ Object



50
51
52
# File 'lib/transpec/syntax/mixin/any_instance_block.rb', line 50

def new_syntax
  "#{base_syntax} { |instance, arg| }"
end

#old_syntax ⇒ Object



46
47
48
# File 'lib/transpec/syntax/mixin/any_instance_block.rb', line 46

def old_syntax
  "#{base_syntax} { |arg| }"
end