Class: Bgem::Output::Exts::RB::Class

Inherits:
Object
  • Object
show all
Includes:
Bgem::Output::Exts::RB
Defined in:
lib/bgem.rb

Instance Attribute Summary

Attributes included from Bgem::Output::Ext::Common

#code, #dir, #file_extension, #name, #type

Instance Method Summary collapse

Methods included from Bgem::Output::Exts::RB

#body, default, #to_s, #wrap

Methods included from Bgem::Output::Ext::StandardHooks::DSL

#hook

Methods included from Bgem::Output::Ext::StandardHooks::Helpers

#concatenate, #sort_with_order_file, #sorted_files_in

Methods included from Bgem::Output::Ext::Common

#ext, #initialize

Instance Method Details

#headObject



265
266
267
268
269
270
271
# File 'lib/bgem.rb', line 265

def head
  if subclass?
    "class #{@name} < #{@parent}\n"
  else
    "class #{@name}\n"
  end
end

#setupObject



261
262
263
# File 'lib/bgem.rb', line 261

def setup
  @name, _colon, @parent = @name.partition ':'
end

#subclass?Boolean

Returns:

  • (Boolean)


273
274
275
# File 'lib/bgem.rb', line 273

def subclass?
  not @parent.empty?
end