Class: Lutaml::Xsd::Spa::Svg::Config::ComponentRules
- Inherits:
-
Object
- Object
- Lutaml::Xsd::Spa::Svg::Config::ComponentRules
- Defined in:
- lib/lutaml/xsd/spa/svg/config/component_rules.rb
Overview
Value object for component rendering rules
Instance Method Summary collapse
- #attribute ⇒ Object
- #element ⇒ Object
- #group ⇒ Object
-
#initialize(components_hash) ⇒ ComponentRules
constructor
A new instance of ComponentRules.
- #rule_for(component_type) ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(components_hash) ⇒ ComponentRules
Returns a new instance of ComponentRules.
10 11 12 |
# File 'lib/lutaml/xsd/spa/svg/config/component_rules.rb', line 10 def initialize(components_hash) @components = components_hash end |
Instance Method Details
#attribute ⇒ Object
26 27 28 |
# File 'lib/lutaml/xsd/spa/svg/config/component_rules.rb', line 26 def attribute rule_for("attribute") end |
#element ⇒ Object
18 19 20 |
# File 'lib/lutaml/xsd/spa/svg/config/component_rules.rb', line 18 def element rule_for("element") end |
#group ⇒ Object
30 31 32 |
# File 'lib/lutaml/xsd/spa/svg/config/component_rules.rb', line 30 def group rule_for("group") end |
#rule_for(component_type) ⇒ Object
14 15 16 |
# File 'lib/lutaml/xsd/spa/svg/config/component_rules.rb', line 14 def rule_for(component_type) ComponentRule.new(@components[component_type.to_s] || {}) end |
#type ⇒ Object
22 23 24 |
# File 'lib/lutaml/xsd/spa/svg/config/component_rules.rb', line 22 def type rule_for("type") end |