Class: Garb::Destination

Inherits:
Object
  • Object
show all
Defined in:
lib/garb/destination.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Destination

Returns a new instance of Destination.



7
8
9
10
11
12
13
14
15
16
# File 'lib/garb/destination.rb', line 7

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

Instance Attribute Details

#case_sensitiveObject (readonly) Also known as: case_sensitive?

Returns the value of attribute case_sensitive.



3
4
5
# File 'lib/garb/destination.rb', line 3

def case_sensitive
  @case_sensitive
end

#expressionObject (readonly)

Returns the value of attribute expression.



3
4
5
# File 'lib/garb/destination.rb', line 3

def expression
  @expression
end

#match_typeObject (readonly)

Returns the value of attribute match_type.



3
4
5
# File 'lib/garb/destination.rb', line 3

def match_type
  @match_type
end

#stepsObject (readonly)

Returns the value of attribute steps.



3
4
5
# File 'lib/garb/destination.rb', line 3

def steps
  @steps
end