Class: Terraspace::Builder::Allow::Region
- Defined in:
- lib/terraspace/builder/allow/region.rb
Instance Method Summary collapse
-
#check_value ⇒ Object
interface method.
- #config_name ⇒ Object
- #current_region ⇒ Object
-
#message ⇒ Object
interface method.
Methods inherited from Base
#allowed?, #allows, #check!, #denys, #initialize
Methods included from App::CallableOption::Concern
Constructor Details
This class inherits a constructor from Terraspace::Builder::Allow::Base
Instance Method Details
#check_value ⇒ Object
interface method
14 15 16 |
# File 'lib/terraspace/builder/allow/region.rb', line 14 def check_value current_region end |
#config_name ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/terraspace/builder/allow/region.rb', line 23 def config_name if config.allow.locations || config.deny.locations :locations # ActiveSuport::HashWithIndifferentAccess#dig requires symbol else super # :regions end end |
#current_region ⇒ Object
18 19 20 21 |
# File 'lib/terraspace/builder/allow/region.rb', line 18 def current_region = Terraspace::Compiler::Expander.autodetect(@mod). .region end |
#message ⇒ Object
interface method
4 5 6 7 8 9 10 11 |
# File 'lib/terraspace/builder/allow/region.rb', line 4 def = [] word = config_name.to_s # IE: regions or locations << "This #{word.singularize} is not allowed to be used: Detected current #{word.singularize}=#{current_region}" << "Allow #{word}: #{allows.join(', ')}" if allows << "Deny #{word}: #{denys.join(', ')}" if denys .join("\n") end |