Class: RgGen::Core::InputBase::Feature
Instance Attribute Summary collapse
#component
Class Method Summary
collapse
Instance Method Summary
collapse
included
#feature_name, #initialize
extended, #feature_array_variable_get, #feature_hash_array_variable_get, #feature_hash_variable_fetch, #feature_hash_variable_get, #feaure_scala_variable_get
#attach_context
Instance Attribute Details
Returns the value of attribute position.
109
110
111
|
# File 'lib/rggen/core/input_base/feature.rb', line 109
def position
@position
end
|
Class Method Details
.active_feature? ⇒ Boolean
17
18
19
|
# File 'lib/rggen/core/input_base/feature.rb', line 17
def active_feature?
!passive_feature?
end
|
.passive_feature? ⇒ Boolean
21
22
23
|
# File 'lib/rggen/core/input_base/feature.rb', line 21
def passive_feature?
feature_array_variable_get(:@builders).nil?
end
|
.properties ⇒ Object
13
14
15
|
# File 'lib/rggen/core/input_base/feature.rb', line 13
def properties
feature_hash_variable_get(:@properties)&.keys
end
|
Instance Method Details
#build(*args) ⇒ Object
74
75
76
77
78
79
|
# File 'lib/rggen/core/input_base/feature.rb', line 74
def build(*args)
builders = feature_array_variable_get(:@builders)
return unless builders
do_build(builders, args)
end
|
#error_position ⇒ Object
111
112
113
114
115
116
117
118
119
|
# File 'lib/rggen/core/input_base/feature.rb', line 111
def error_position
if position
position
else
approximate_position =
component.features.map(&:position).find(&:itself)
ApproximatelyErrorPosition.create(approximate_position)
end
end
|
#ignore_empty_value? ⇒ Boolean
86
87
88
89
|
# File 'lib/rggen/core/input_base/feature.rb', line 86
def ignore_empty_value?
feaure_scala_variable_get(:@ignore_empty_value)
.then { _1.nil? || _1 }
end
|
104
105
106
107
|
# File 'lib/rggen/core/input_base/feature.rb', line 104
def inspect
printable_values = printables&.map { |name, value| "#{name}: #{value.inspect}" }
(printable_values && "#{super}[#{printable_values.join(', ')}]") || super
end
|
#post_build ⇒ Object
81
82
83
84
|
# File 'lib/rggen/core/input_base/feature.rb', line 81
def post_build
feature_array_variable_get(:@post_builders)
&.each { |block| instance_exec(&block) }
end
|
#printable? ⇒ Boolean
100
101
102
|
# File 'lib/rggen/core/input_base/feature.rb', line 100
def printable?
!feature_hash_variable_get(:@printables).nil?
end
|
#printables ⇒ Object
95
96
97
98
|
# File 'lib/rggen/core/input_base/feature.rb', line 95
def printables
feature_hash_variable_get(:@printables)
&.map { |name, body| [name, printable(name, &body)] }
end
|
#properties ⇒ Object
70
71
72
|
# File 'lib/rggen/core/input_base/feature.rb', line 70
def properties
feature_hash_variable_get(:@properties)&.keys
end
|
#verify(scope) ⇒ Object
91
92
93
|
# File 'lib/rggen/core/input_base/feature.rb', line 91
def verify(scope)
verified?(scope) || do_verify(scope)
end
|