Class: CascadingConfiguration::Core::InstanceController

Inherits:
Module
  • Object
show all
Defined in:
lib/namespaces.rb,
lib/cascading_configuration/core/instance_controller.rb

Defined Under Namespace

Modules: Methods Classes: ExtensionModule, SupportModule

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(instance, default_encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation, extending = false) ⇒ InstanceController

initialize #



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/cascading_configuration/core/instance_controller.rb', line 69

def initialize( instance, 
                default_encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation, 
                extending = false )

  @instance = instance.extend( ::Module::Cluster )
  
  if @instance.is_a?( ::Module )
    initialize_constant_in_instance
  else
    initialize_constant_in_self
  end

  # We manage reference to self in singleton from here to avoid duplicative efforts.
  reference_to_self = self
  self.class.class_eval do
    @instance_controller[ instance ] = reference_to_self
  end
  
  # We need an encapsulation to manage automatic inheritance relations.
  @default_encapsulation = ::CascadingConfiguration::Core::
                             Encapsulation.encapsulation( default_encapsulation_or_name )
  
  # We also support arbitrary additional encapsulations.
  @encapsulations = { }
  
  @support_modules = { }
  
  @extension_modules = { }
  
  # create a cascading block to register configurations for parent at include/extend
  initialize_inheritance_for_instance( @instance, extending )
      
end

Instance Attribute Details

#default_encapsulationObject (readonly)

default_encapsulation #



196
197
198
# File 'lib/cascading_configuration/core/instance_controller.rb', line 196

def default_encapsulation
  @default_encapsulation
end

#instanceObject (readonly)

instance #



202
203
204
# File 'lib/cascading_configuration/core/instance_controller.rb', line 202

def instance
  @instance
end

Class Method Details

.create_instance_controller(instance, default_encapsulation_or_name = ::CascadingConfiguration::Core:: Module::DefaultEncapsulation, extending = false) ⇒ Object

self.create_instance_controller #



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/cascading_configuration/core/instance_controller.rb', line 10

def self.create_instance_controller( instance,
                                     default_encapsulation_or_name = ::CascadingConfiguration::Core::
                                                                       Module::DefaultEncapsulation, 
                                     extending = false )
  
  instance_controller = nil
  
  unless instance_controller = @instance_controller[ instance ]
    instance_controller = new( instance, default_encapsulation_or_name, extending )
  end
  
  return instance_controller
  
end

.instance_controller(instance, ensure_exists = false) ⇒ Object

self.instance_controller #



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/cascading_configuration/core/instance_controller.rb', line 29

def self.instance_controller( instance, ensure_exists = false )
  
  instance_controller_instance = nil
  
  unless instance_controller_instance = @instance_controller[ instance ]
    if ensure_exists
      exception_string = 'No module controller defined for :' << instance.to_s
      exception_string << '.'
      raise ::ArgumentError, exception_string
    end
  end

  return instance_controller_instance
  
end

.nearest_instance_controller(encapsulation, instance, name) ⇒ Object

self.nearest_instance_controller #



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/cascading_configuration/core/instance_controller.rb', line 49

def self.nearest_instance_controller( encapsulation, instance, name )
  
  instance_controller = nil
  
  this_parent = instance

  begin

    break if instance_controller = instance_controller( this_parent )

  end while this_parent = encapsulation.parent_for_configuration( this_parent, name )
  
  return instance_controller
  
end

Instance Method Details

#add_extension_modules(name, encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation, *extension_modules, &definer_block) ⇒ Object

add_extension_modules #



208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# File 'lib/cascading_configuration/core/instance_controller.rb', line 208

def add_extension_modules( name, 
                           encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation, 
                           *extension_modules, 
                           & definer_block )

  encapsulation = ::CascadingConfiguration::Core::Encapsulation.encapsulation( encapsulation_or_name )
  
  if block_given?
    
    new_module = self.class::ExtensionModule.new( self, encapsulation, name, & definer_block )

    constant_name = encapsulation.encapsulation_name.to_s.to_camel_case + '_' << name.to_s
    const_set( constant_name, new_module )

    extension_modules.push( new_module )

  end
  
  extension_modules.reverse!
  
  if extension_modules_array = @extension_modules[ name ]
    extension_modules_array.concat( extension_modules )
  else
    @extension_modules[ name ] = extension_modules_array = extension_modules
  end
  
  return extension_modules_array
  
end

#alias_instance_method(alias_name, name, encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation) ⇒ Object

alias_instance_method #



594
595
596
597
598
599
600
601
602
603
604
605
606
# File 'lib/cascading_configuration/core/instance_controller.rb', line 594

def alias_instance_method( alias_name, 
                           name, 
                           encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation )

  aliased_method = false
  
  if instance_support = instance_support( encapsulation_or_name )
    aliased_method = instance_support.alias_method( alias_name, name )
  end
  
  return aliased_method

end

#alias_local_instance_method(alias_name, name, encapsulation_or_name = ::CascadingConfiguration::Core:: Module::DefaultEncapsulation) ⇒ Object

alias_local_instance_method #



625
626
627
628
629
630
631
632
633
634
635
636
637
638
# File 'lib/cascading_configuration/core/instance_controller.rb', line 625

def alias_local_instance_method( alias_name, 
                                 name, 
                                 encapsulation_or_name = ::CascadingConfiguration::Core::
                                                           Module::DefaultEncapsulation )

  aliased_method = false
  
  if local_instance_support = local_instance_support( encapsulation_or_name )
    aliased_method = local_instance_support.alias_method( alias_name, name, encapsulation_or_name )
  end
  
  return aliased_method

end

#alias_module_and_instance_methods(alias_name, name, encapsulation_or_name = ::CascadingConfiguration::Core:: Module::DefaultEncapsulation) ⇒ Object

alias_module_and_instance_methods #



702
703
704
705
706
707
708
709
710
# File 'lib/cascading_configuration/core/instance_controller.rb', line 702

def alias_module_and_instance_methods( alias_name, 
                                       name, 
                                       encapsulation_or_name = ::CascadingConfiguration::Core::
                                                                 Module::DefaultEncapsulation )
  
  alias_module_method( alias_name, name, encapsulation_or_name )
  alias_instance_method( alias_name, name, encapsulation_or_name )
  
end

#alias_module_method(alias_name, name, encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation) ⇒ Object

alias_module_method #



481
482
483
484
485
486
487
488
489
490
491
492
493
# File 'lib/cascading_configuration/core/instance_controller.rb', line 481

def alias_module_method( alias_name, 
                         name, 
                         encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation )

  aliased_method = false
  
  if singleton_support = singleton_support( encapsulation_or_name )
    aliased_method = singleton_support.alias_method( alias_name, name )
  end
  
  return aliased_method

end

#create_instance_support(encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation) ⇒ Object

create_instance_support #



403
404
405
406
407
408
409
410
411
412
413
# File 'lib/cascading_configuration/core/instance_controller.rb', line 403

def create_instance_support( encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation )

  return create_support( :instance, 
                         encapsulation_or_name, 
                         self.class::SupportModule::InstanceSupportModule, 
                         true, 
                         false, 
                         true, 
                         false )

end

#create_local_instance_support(encapsulation_or_name = ::CascadingConfiguration::Core:: Module::DefaultEncapsulation) ⇒ Object

create_local_instance_support #



429
430
431
432
433
434
# File 'lib/cascading_configuration/core/instance_controller.rb', line 429

def create_local_instance_support( encapsulation_or_name = ::CascadingConfiguration::Core::
                                                             Module::DefaultEncapsulation )

  return create_support( :local_instance, encapsulation_or_name, nil, false, true, false, false )

end

#create_singleton_support(encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation) ⇒ Object

create_singleton_support #



377
378
379
380
381
382
383
384
385
386
387
# File 'lib/cascading_configuration/core/instance_controller.rb', line 377

def create_singleton_support( encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation )

  return create_support( :singleton, 
                         encapsulation_or_name, 
                         self.class::SupportModule::SingletonSupportModule, 
                         false, 
                         true, 
                         false, 
                         true )

end

#create_support(module_type_name, encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation, support_module_class = ::CascadingConfiguration::Core::InstanceController::SupportModule, should_include = false, should_extend = false, should_cascade_includes = false, should_cascade_extends = false, module_constant_name = module_type_name.to_s.to_camel_case) ⇒ Object

create_support #



291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
# File 'lib/cascading_configuration/core/instance_controller.rb', line 291

def create_support( module_type_name,
                    encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation,
                    support_module_class = ::CascadingConfiguration::Core::InstanceController::SupportModule,
                    should_include = false, 
                    should_extend = false, 
                    should_cascade_includes = false, 
                    should_cascade_extends = false,
                    module_constant_name = module_type_name.to_s.to_camel_case )

  encapsulation = ::CascadingConfiguration::Core::Encapsulation.encapsulation( encapsulation_or_name )
  
  # permit nil for support_module_class to default
  support_module_class ||= ::CascadingConfiguration::Core::InstanceController::SupportModule
  
  unless encapsulation_supports_hash = @support_modules[ encapsulation ]
    encapsulation_supports_hash = { }
    @support_modules[ encapsulation ] = encapsulation_supports_hash
  end
  
  unless support_module_instance = encapsulation_supports_hash[ module_type_name ]

    # New Instance
  
    support_module_instance = support_module_class.new( self, encapsulation, module_type_name )
  
    const_set( module_constant_name, support_module_instance )

    encapsulation_supports_hash[ module_type_name ] = support_module_instance
  
    # Cascades
  
    if should_cascade_includes
      @instance.cluster( :cascading_configuration ).after_include.cascade.include( support_module_instance )
    end
  
    if should_cascade_extends
      @instance.cluster( :cascading_configuration ).after_include.cascade.extend( support_module_instance )
    end
  
    # Includes/Extends
  
    if should_include
      case @instance
        # we can only include in modules
        when ::Module
          @instance.module_eval do
            include support_module_instance
          end
        # but we might be told to create instance support on instances, in which case we need to extend
        else
          @instance.extend( support_module_instance )
      end
    end
      
    if should_extend
      @instance.extend( support_module_instance )
    end

  end
  
  return support_module_instance
  
end

#define_configuration_methods(ccm, encapsulation_or_name, method_types, names, &definer_block) ⇒ Object

define_configuration_methods #



450
451
452
453
454
455
456
457
458
459
460
461
462
463
# File 'lib/cascading_configuration/core/instance_controller.rb', line 450

def define_configuration_methods( ccm, encapsulation_or_name, method_types, names, & definer_block )

  encapsulation = ::CascadingConfiguration::Core::Encapsulation.encapsulation( encapsulation_or_name )

  accessors = parse_names_for_accessors( *names )
  
  accessors.each do |this_name, this_write_name|
    define_getter( ccm, this_name, this_name, method_types, encapsulation )
    define_setter( ccm, this_name, this_write_name, method_types, encapsulation )
  end
  
  return accessors
  
end

#define_instance_method(name, encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation, &method_proc) ⇒ Object

define_instance_method #



531
532
533
534
535
536
537
# File 'lib/cascading_configuration/core/instance_controller.rb', line 531

def define_instance_method( name, 
                            encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation, 
                            & method_proc )

  return create_instance_support( encapsulation_or_name ).define_method( name, & method_proc )
  
end

#define_instance_method_if_support(name, encapsulation_or_name = ::CascadingConfiguration::Core:: Module::DefaultEncapsulation, &method_proc) ⇒ Object

define_instance_method_if_support #



577
578
579
580
581
582
583
584
585
586
587
588
# File 'lib/cascading_configuration/core/instance_controller.rb', line 577

def define_instance_method_if_support( name, 
                                       encapsulation_or_name = ::CascadingConfiguration::Core::
                                                                 Module::DefaultEncapsulation, 
                                       & method_proc )

  if instance_support = instance_support( encapsulation_or_name )
    instance_support.define_method( name, & method_proc )
  end 
  
  return self
  
end

#define_local_instance_method(name, encapsulation_or_name = ::CascadingConfiguration::Core:: Module::DefaultEncapsulation, &method_proc) ⇒ Object

define_local_instance_method #



612
613
614
615
616
617
618
619
# File 'lib/cascading_configuration/core/instance_controller.rb', line 612

def define_local_instance_method( name, 
                                  encapsulation_or_name = ::CascadingConfiguration::Core::
                                                            Module::DefaultEncapsulation, 
                                  & method_proc )

  return create_local_instance_support( encapsulation_or_name ).define_method( name, & method_proc )

end

#define_singleton_and_instance_methods(name, encapsulation_or_name, &method_proc) ⇒ Object

define_singleton_and_instance_methods #



680
681
682
683
684
685
# File 'lib/cascading_configuration/core/instance_controller.rb', line 680

def define_singleton_and_instance_methods( name, encapsulation_or_name, & method_proc )

  define_singleton_method( name, encapsulation_or_name, & method_proc )
  define_instance_method( name, encapsulation_or_name, & method_proc )

end

#define_singleton_method(name, encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation, &method_proc) ⇒ Object

define_singleton_method #



469
470
471
472
473
474
475
# File 'lib/cascading_configuration/core/instance_controller.rb', line 469

def define_singleton_method( name, 
                             encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation, 
                             & method_proc )

  return create_singleton_support( encapsulation_or_name ).define_method( name, & method_proc )

end

#define_singleton_method_and_instance_method_if_support(name, encapsulation_or_name, &method_proc) ⇒ Object

define_singleton_method_and_instance_method_if_support #



691
692
693
694
695
696
# File 'lib/cascading_configuration/core/instance_controller.rb', line 691

def define_singleton_method_and_instance_method_if_support( name, encapsulation_or_name, & method_proc )

  define_singleton_method( name, encapsulation_or_name, & method_proc )
  define_instance_method_if_support( name, encapsulation_or_name, & method_proc )

end

#extension_modules(name = nil, encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation) ⇒ Object

extension_modules #



242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
# File 'lib/cascading_configuration/core/instance_controller.rb', line 242

def extension_modules( name = nil, 
                       encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation )
  
  encapsulation = ::CascadingConfiguration::Core::Encapsulation.encapsulation( encapsulation_or_name )
  
  extension_modules = nil
  
  if name
    extension_modules = @extension_modules[ name ]
  else
    extension_modules = @extension_modules
  end
  
  return extension_modules
  
end

#extension_modules_upward(name, encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation) ⇒ Object

extension_modules_upward #



263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# File 'lib/cascading_configuration/core/instance_controller.rb', line 263

def extension_modules_upward( name, 
                              encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation )
  
  extension_modules = [ ]
  
  encapsulation = ::CascadingConfiguration::Core::Encapsulation.encapsulation( encapsulation_or_name )
  
  this_ancestor = @instance
  
  begin
    
    if ancestor_controller = self.class.instance_controller( this_ancestor ) and
       these_modules = ancestor_controller.extension_modules( name, encapsulation )
      
      extension_modules.concat( these_modules )
    
    end
    
  end while this_ancestor = encapsulation.parent_for_configuration( this_ancestor, name )
  
  return extension_modules
  
end

#initialize_constant_in_instanceObject

initialize_constant_in_self #



107
108
109
110
111
# File 'lib/cascading_configuration/core/instance_controller.rb', line 107

def initialize_constant_in_instance

  @instance.const_set( :Controller, self )

end

#initialize_constant_in_selfObject

initialize_constant_in_self #



117
118
119
120
121
122
123
124
125
# File 'lib/cascading_configuration/core/instance_controller.rb', line 117

def initialize_constant_in_self
  
  hex_id_string = '0x%x' % ( @instance.__id__ << 1 )
  constant = 'ID_' << hex_id_string
  self.class.const_set( :Controller, self )
  
  return self
  
end

#initialize_encapsulation_for_inheriting_instance(encapsulation, parent_instance, instance) ⇒ Object

initialize_encapsulation_for_inheriting_instance #



186
187
188
189
190
# File 'lib/cascading_configuration/core/instance_controller.rb', line 186

def initialize_encapsulation_for_inheriting_instance( encapsulation, parent_instance, instance )

  encapsulation.register_child_for_parent( instance, parent_instance )
  
end

#initialize_inheritance_for_instance(instance, extending = false) ⇒ Object

initialize_inheritance_for_instance #



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'lib/cascading_configuration/core/instance_controller.rb', line 131

def initialize_inheritance_for_instance( instance, extending = false )

  unless instance.is_a?( ::Module::Cluster ) and instance.has_cluster?( :cascading_configuration_inheritance )
    
    instance.extend( ::Module::Cluster )
    
    reference_to_self = self
    
    case instance
    
      when ::Class
      
        instance.cluster( :cascading_configuration_inheritance ).subclass do |inheriting_instance|
          reference_to_self.initialize_inheriting_instance( self, inheriting_instance )
        end
    
      when ::Module
      
        unless extending

          instance.cluster( :cascading_configuration_inheritance ).before_include do |inheriting_instance|
            reference_to_self.initialize_inheriting_instance( self, inheriting_instance )
            reference_to_self.initialize_inheritance_for_instance( inheriting_instance )
          end

          instance.cluster( :cascading_configuration_inheritance ).before_extend do |inheriting_instance|
            reference_to_self.initialize_inheriting_instance( self, inheriting_instance )
          end

        end
        
    end

  end
  
end

#initialize_inheriting_instance(parent_instance, instance) ⇒ Object

initialize_inheriting_instance #



172
173
174
175
176
177
178
179
180
# File 'lib/cascading_configuration/core/instance_controller.rb', line 172

def initialize_inheriting_instance( parent_instance, instance )
  
  initialize_encapsulation_for_inheriting_instance( @default_encapsulation, parent_instance, instance )

  @encapsulations.each do |this_encapsulation_name, this_encapsulation|
    initialize_encapsulations_for_inheriting_instance( this_encapsulation, parent_instance, instance )
  end
  
end

#instance_support(encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation) ⇒ Object

instance_support #



419
420
421
422
423
# File 'lib/cascading_configuration/core/instance_controller.rb', line 419

def instance_support( encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation )

  return support( :instance, encapsulation_or_name )

end

#local_instance_support(encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation) ⇒ Object

local_instance_support #



440
441
442
443
444
# File 'lib/cascading_configuration/core/instance_controller.rb', line 440

def local_instance_support( encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation )

  return support( :local_instance, encapsulation_or_name )

end

#remove_instance_method(name, encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation) ⇒ Object

remove_instance_method #



543
544
545
546
547
548
549
550
551
552
553
554
# File 'lib/cascading_configuration/core/instance_controller.rb', line 543

def remove_instance_method( name, 
                            encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation )

  removed_method = false

  if instance_support = instance_support( encapsulation_or_name )
    removed_method = instance_support.remove_method( name )
  end
  
  return removed_method
  
end

#remove_local_instance_method(name, encapsulation_or_name = ::CascadingConfiguration::Core:: Module::DefaultEncapsulation) ⇒ Object

remove_local_instance_method #



644
645
646
647
648
649
650
651
652
653
654
655
656
# File 'lib/cascading_configuration/core/instance_controller.rb', line 644

def remove_local_instance_method( name, 
                                  encapsulation_or_name = ::CascadingConfiguration::Core::
                                                            Module::DefaultEncapsulation )

  removed_method = false

  if local_instance_support = local_instance_support( encapsulation_or_name )
    removed_method = local_instance_support.remove_method( name )
  end
  
  return removed_method
  
end

#remove_module_method(name, encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation) ⇒ Object

remove_module_method #



499
500
501
502
503
504
505
506
507
508
509
# File 'lib/cascading_configuration/core/instance_controller.rb', line 499

def remove_module_method( name, encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation )

  removed_method = false

  if singleton_support = singleton_support( encapsulation_or_name )
    removed_method = singleton_support.remove_method( name )
  end
  
  return removed_method
  
end

#singleton_support(encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation) ⇒ Object

singleton_support #



393
394
395
396
397
# File 'lib/cascading_configuration/core/instance_controller.rb', line 393

def singleton_support( encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation )

  return support( :singleton, encapsulation_or_name )

end

#support(module_type_name, encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation) ⇒ Object

support #



359
360
361
362
363
364
365
366
367
368
369
370
371
# File 'lib/cascading_configuration/core/instance_controller.rb', line 359

def support( module_type_name, encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation )
  
  support_instance = nil
  
  encapsulation = ::CascadingConfiguration::Core::Encapsulation.encapsulation( encapsulation_or_name )
  
  if encapsulation_supports_hash = @support_modules[ encapsulation ]
    support_instance = encapsulation_supports_hash[ module_type_name ]
  end
  
  return support_instance
  
end

#undef_instance_method(name, encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation) ⇒ Object

undef_instance_method #



560
561
562
563
564
565
566
567
568
569
570
571
# File 'lib/cascading_configuration/core/instance_controller.rb', line 560

def undef_instance_method( name, 
                           encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation )

  undefined_method = false

  if instance_support = instance_support( encapsulation_or_name )
    undefined_method = instance_support.undef_method( name )
  end
  
  return undefined_method
  
end

#undef_local_instance_method(name, encapsulation_or_name = ::CascadingConfiguration::Core:: Module::DefaultEncapsulation) ⇒ Object

undef_local_instance_method #



662
663
664
665
666
667
668
669
670
671
672
673
674
# File 'lib/cascading_configuration/core/instance_controller.rb', line 662

def undef_local_instance_method( name, 
                                 encapsulation_or_name = ::CascadingConfiguration::Core::
                                                           Module::DefaultEncapsulation )

  undefined_method = false

  if local_instance_support = local_instance_support( encapsulation_or_name )
    undefined_method = local_instance_support.undef_method( name )
  end
  
  return undefined_method
  
end

#undef_module_method(name, encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation) ⇒ Object

undef_module_method #



515
516
517
518
519
520
521
522
523
524
525
# File 'lib/cascading_configuration/core/instance_controller.rb', line 515

def undef_module_method( name, encapsulation_or_name = ::CascadingConfiguration::Core::Module::DefaultEncapsulation )

  undefined_method = false

  if singleton_support = singleton_support( encapsulation_or_name )
    undefined_method = singleton_support.undef_method( name )
  end
  
  return undefined_method
  
end