Class: AnnFlavorCore::AnnSpec
- Inherits:
-
Struct
- Object
- Struct
- AnnFlavorCore::AnnSpec
- Defined in:
- lib/vendor/ann_flavor_core/lib/ann_flavor_core/model.rb
Overview
── Top-level ───────────────────────────────────────────────────────────────
Instance Attribute Summary collapse
-
#app ⇒ Object
Returns the value of attribute app.
-
#debug_config ⇒ Object
Returns the value of attribute debug_config.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#tooling ⇒ Object
Returns the value of attribute tooling.
Class Method Summary collapse
Instance Method Summary collapse
-
#flavor_exists_on?(platform_key, flavor_key) ⇒ Boolean
Whether flavor
flavor_keyhas an entry under app.<platform_key>.flavor in the spec — i.e.
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app
14 15 16 |
# File 'lib/vendor/ann_flavor_core/lib/ann_flavor_core/model.rb', line 14 def app @app end |
#debug_config ⇒ Object
Returns the value of attribute debug_config
14 15 16 |
# File 'lib/vendor/ann_flavor_core/lib/ann_flavor_core/model.rb', line 14 def debug_config @debug_config end |
#enabled ⇒ Object
Returns the value of attribute enabled
14 15 16 |
# File 'lib/vendor/ann_flavor_core/lib/ann_flavor_core/model.rb', line 14 def enabled @enabled end |
#tooling ⇒ Object
Returns the value of attribute tooling
14 15 16 |
# File 'lib/vendor/ann_flavor_core/lib/ann_flavor_core/model.rb', line 14 def tooling @tooling end |
Class Method Details
.defaults ⇒ Object
15 |
# File 'lib/vendor/ann_flavor_core/lib/ann_flavor_core/model.rb', line 15 def self.defaults = new(app: AnnApp.new, enabled: true, debug_config: DebugConfig.new) |
Instance Method Details
#flavor_exists_on?(platform_key, flavor_key) ⇒ Boolean
Whether flavor flavor_key has an entry under app.<platform_key>.flavor
in the spec — i.e. whether this flavor actually targets that platform.
platform_key is 'android', 'ios', 'web', or 'windows' (any other
value returns false). This says nothing about whether the platform
itself is configured for the app at all — a platform absent from app
entirely also returns false here, the same as a platform that exists
but doesn't list this flavor. Callers that need to distinguish those
two cases should check app.<platform_key>.nil? separately.
26 27 28 29 30 31 32 33 34 |
# File 'lib/vendor/ann_flavor_core/lib/ann_flavor_core/model.rb', line 26 def flavor_exists_on?(platform_key, flavor_key) platform = case platform_key when 'android' then app&.android when 'ios' then app&.ios when 'web' then app&.web when 'windows' then app&.windows end platform&.flavors&.key?(flavor_key) || false end |