Class: Bullshit::Case::CaseExtension::TruncateData

Inherits:
Object
  • Object
show all
Extended by:
DSLKit::Constant, DSLKit::DSLAccessor
Includes:
Bullshit::CommonConstants, ModuleFunctions
Defined in:
lib/bullshit.rb

Instance Method Summary collapse

Methods included from ModuleFunctions

angle, array_window, percent

Constructor Details

#initialize(enable, &block) ⇒ TruncateData

Returns a new instance of TruncateData.



1507
1508
1509
1510
1511
1512
1513
1514
1515
# File 'lib/bullshit.rb', line 1507

def initialize(enable, &block)
  if block
    enable.nil? or raise ArgumentError, "block form doesn't take an argument"
    instance_eval(&block)
    enabled true
  else
    enabled enable.nil? ? false : enable
  end
end