Class: Lutaml::Xsd::Spa::Svg::Config::ComponentRules

Inherits:
Object
  • Object
show all
Defined in:
lib/lutaml/xsd/spa/svg/config/component_rules.rb

Overview

Value object for component rendering rules

Instance Method Summary collapse

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

#attributeObject



26
27
28
# File 'lib/lutaml/xsd/spa/svg/config/component_rules.rb', line 26

def attribute
  rule_for("attribute")
end

#elementObject



18
19
20
# File 'lib/lutaml/xsd/spa/svg/config/component_rules.rb', line 18

def element
  rule_for("element")
end

#groupObject



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

#typeObject



22
23
24
# File 'lib/lutaml/xsd/spa/svg/config/component_rules.rb', line 22

def type
  rule_for("type")
end