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.



555
556
557
558
559
560
561
562
563
# File 'lib/bullshit.rb', line 555

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