lib/garb/destination.rb in garb-0.9.1 vs lib/garb/destination.rb in garb-0.9.7

- old
+ new

@@ -1,18 +1,17 @@ module Garb class Destination - attr_reader :match_type, :expression, :steps, :case_sensitive + attr_reader :match_type, :url, :steps, :case_sensitive alias :case_sensitive? :case_sensitive def initialize(attributes) - return unless attributes.is_a?(Hash) + return unless attributes.is_a? Hash @match_type = attributes['matchType'] - @expression = attributes['expression'] - @case_sensitive = (attributes['caseSensitive'] == 'true') + @url = attributes['url'] # TODO was @expression + @case_sensitive = attributes['caseSensitive'] - step_attributes = attributes[Garb.to_ga('step')] - @steps = Array(step_attributes.is_a?(Hash) ? [step_attributes] : step_attributes).map {|s| Step.new(s)} + @steps = attributes['steps'] && attributes['steps'].map { |s| Step.new(s) } end end end