Class: Turbo::PathConfigurationDecoder
- Inherits:
-
Object
- Object
- Turbo::PathConfigurationDecoder
- Defined in:
- lib/turbo/path_configuration/path_configuration_decoder.rb
Instance Attribute Summary collapse
-
#rules ⇒ Object
Returns the value of attribute rules.
-
#settings ⇒ Object
Returns the value of attribute settings.
Instance Method Summary collapse
Instance Attribute Details
#rules ⇒ Object
Returns the value of attribute rules.
3 4 5 |
# File 'lib/turbo/path_configuration/path_configuration_decoder.rb', line 3 def rules @rules end |
#settings ⇒ Object
Returns the value of attribute settings.
3 4 5 |
# File 'lib/turbo/path_configuration/path_configuration_decoder.rb', line 3 def settings @settings end |
Instance Method Details
#initWithJSON(json) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/turbo/path_configuration/path_configuration_decoder.rb', line 11 def initWithJSON(json) # rules must be present, settings are optional #guard let rulesArray = json["rules"] as? [[String: AnyHashable]] else { #throw JSONDecodingError.invalidJSON #} rules = json["rules"].map do |rule| PathRule.alloc.initWithRule(rule) end settings = json["settings"] initWithSettings(settings, rules: rules) end |
#initWithSettings(settings, rules: rules) ⇒ Object
5 6 7 8 9 |
# File 'lib/turbo/path_configuration/path_configuration_decoder.rb', line 5 def initWithSettings(settings, rules: rules) self.settings = settings self.rules = rules self end |