Module: Bgem::Output::Exts::RB

Includes:
Bgem::Output::Ext::Common, Bgem::Output::Ext::StandardHooks
Included in:
Class, Module
Defined in:
lib/bgem.rb

Defined Under Namespace

Classes: Class, Module

Instance Attribute Summary collapse

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

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

Class Method Summary collapse

Instance Method Summary collapse

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, #setup

Instance Attribute Details

#headObject (readonly)

Returns the value of attribute head.



241
242
243
# File 'lib/bgem.rb', line 241

def head
  @head
end

Class Method Details

.defaultObject



237
238
239
# File 'lib/bgem.rb', line 237

def self.default
  'module'
end

Instance Method Details

#bodyObject



247
248
249
# File 'lib/bgem.rb', line 247

def body
  wrap code
end

#to_sObject



243
244
245
# File 'lib/bgem.rb', line 243

def to_s
  "#{head}#{body}end"
end

#wrap(code) ⇒ Object



251
252
253
254
255
256
# File 'lib/bgem.rb', line 251

def wrap code
  code = @code.indent INDENT
  code.prepend "#{pre}\n\n" unless pre.empty?
  code.concat "\n#{post}\n" unless post.empty?
  code
end