cascading-configuration-setting 1.3.3 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/cascading-configuration-setting/CascadingConfiguration/Setting/AccessorDefinitionMethods.rb
CHANGED
@@ -99,10 +99,10 @@ module CascadingConfiguration::Setting::AccessorDefinitionMethods
|
|
99
99
|
end
|
100
100
|
|
101
101
|
##########################################
|
102
|
-
#
|
102
|
+
# define_instance_configuration_setter #
|
103
103
|
##########################################
|
104
104
|
|
105
|
-
def
|
105
|
+
def define_instance_configuration_setter( configuration_name )
|
106
106
|
configuration_setter_name = ( configuration_name.to_s + '=' ).to_s
|
107
107
|
accessor_local_instance_support.module_eval do
|
108
108
|
define_method( configuration_setter_name ) do |value|
|
@@ -113,10 +113,10 @@ module CascadingConfiguration::Setting::AccessorDefinitionMethods
|
|
113
113
|
end
|
114
114
|
|
115
115
|
##########################################
|
116
|
-
#
|
116
|
+
# define_instance_configuration_getter #
|
117
117
|
##########################################
|
118
118
|
|
119
|
-
def
|
119
|
+
def define_instance_configuration_getter( configuration_name )
|
120
120
|
configuration_getter_name = configuration_name
|
121
121
|
accessor_local_instance_support.module_eval do
|
122
122
|
define_method( configuration_getter_name ) do
|
@@ -54,18 +54,18 @@ module CascadingConfiguration::Setting::Interface
|
|
54
54
|
end
|
55
55
|
|
56
56
|
#################################
|
57
|
-
#
|
57
|
+
# attr_instance_configuration #
|
58
58
|
#################################
|
59
59
|
|
60
60
|
# local to class or module or instance that declares it
|
61
61
|
# * only in the instance that declares it
|
62
|
-
def
|
62
|
+
def attr_instance_configuration( *property_names )
|
63
63
|
CascadingConfiguration::Variable.define_accessor_local_instance_support( self )
|
64
64
|
property_names.each do |this_property_name|
|
65
65
|
# define configuration setter
|
66
|
-
|
66
|
+
define_instance_configuration_setter( this_property_name )
|
67
67
|
# define configuration getter
|
68
|
-
|
68
|
+
define_instance_configuration_getter( this_property_name )
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
@@ -444,7 +444,7 @@ describe CascadingConfiguration::Setting do
|
|
444
444
|
end
|
445
445
|
|
446
446
|
#################################
|
447
|
-
#
|
447
|
+
# attr_instance_configuration #
|
448
448
|
#################################
|
449
449
|
|
450
450
|
it 'can define a configuration setting for the present instance, which will not cascade' do
|
@@ -460,8 +460,8 @@ describe CascadingConfiguration::Setting do
|
|
460
460
|
module CascadingConfiguration::Setting::LocalConfigurationMockExtended
|
461
461
|
extend CascadingConfiguration::Setting
|
462
462
|
# => singleton gets attr_configuration and configurations
|
463
|
-
respond_to?( :
|
464
|
-
|
463
|
+
respond_to?( :attr_instance_configuration ).should == true
|
464
|
+
attr_instance_configuration :some_configuration
|
465
465
|
respond_to?( :some_configuration ).should == true
|
466
466
|
self.some_configuration = :our_setting_value
|
467
467
|
some_configuration.should == :our_setting_value
|
@@ -500,8 +500,8 @@ describe CascadingConfiguration::Setting do
|
|
500
500
|
module CascadingConfiguration::Setting::InstanceConfigurationMockIncluded
|
501
501
|
include CascadingConfiguration::Setting
|
502
502
|
# => singleton gets attr_configuration and configurations
|
503
|
-
respond_to?( :
|
504
|
-
|
503
|
+
respond_to?( :attr_instance_configuration ).should == true
|
504
|
+
attr_instance_configuration :some_configuration
|
505
505
|
respond_to?( :some_configuration ).should == true
|
506
506
|
self.some_configuration = :our_setting_value
|
507
507
|
some_configuration.should == :our_setting_value
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 1
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 1.
|
7
|
+
- 4
|
8
|
+
- 0
|
9
|
+
version: 1.4.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Asher
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-08-
|
17
|
+
date: 2011-08-08 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|