Sha256: 5d7bff19008595246eab48a0cb3738a44da262af1988b43ba533be097ab1387f

Contents?: true

Size: 555 Bytes

Versions: 4

Compression:

Stored size: 555 Bytes

Contents

module Garb
  class Destination
    attr_reader :match_type, :expression, :steps, :case_sensitive

    alias :case_sensitive? :case_sensitive

    def initialize(attributes)
      return unless attributes.is_a?(Hash)

      @match_type = attributes['matchType']
      @expression = attributes['expression']
      @case_sensitive = (attributes['caseSensitive'] == 'true')

      step_attributes = attributes[Garb.to_ga('step')]
      @steps = Array(step_attributes.is_a?(Hash) ? [step_attributes] : step_attributes).map {|s| Step.new(s)}
    end
  end
end

Version data entries

4 entries across 4 versions & 3 rubygems

Version Path
readmedia-garb-0.9.1.1 lib/garb/destination.rb
vanity-1.7.1 vendor/ruby/1.9.1/gems/garb-0.9.1/lib/garb/destination.rb
garb-0.9.1 lib/garb/destination.rb
garb-0.9.0 lib/garb/destination.rb