Class: DRG::FileContext::BlockDef

Inherits:
Definition show all
Defined in:
lib/drg/file_context.rb

Instance Attribute Summary

Attributes inherited from Definition

#line_number, #name, #open

Instance Method Summary collapse

Methods inherited from Definition

#close, #eql?, #inspect

Methods included from NullDefinition

#class?, #method?, #mod?

Constructor Details

#initialize(name, body, opener, line_number, closer = nil) ⇒ BlockDef

Returns a new instance of BlockDef.



195
196
197
198
# File 'lib/drg/file_context.rb', line 195

def initialize(name, body, opener, line_number, closer = nil)
  super(name, line_number, !!closer) # not open if closer present (single line block)
  @body, @opener, @closer, = body, opener, closer
end

Instance Method Details

#block?Boolean

Returns:

  • (Boolean)


200
201
202
# File 'lib/drg/file_context.rb', line 200

def block?
  true
end