Class: Garb::Destination
- Inherits:
-
Object
- Object
- Garb::Destination
- Defined in:
- lib/garb/destination.rb
Instance Attribute Summary collapse
-
#expression ⇒ Object
readonly
Returns the value of attribute expression.
-
#match_type ⇒ Object
readonly
Returns the value of attribute match_type.
-
#steps ⇒ Object
readonly
Returns the value of attribute steps.
Instance Method Summary collapse
- #case_sensitive? ⇒ Boolean
-
#initialize(attributes) ⇒ Destination
constructor
A new instance of Destination.
Constructor Details
#initialize(attributes) ⇒ Destination
Returns a new instance of Destination.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/garb/destination.rb', line 5 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
#expression ⇒ Object (readonly)
Returns the value of attribute expression.
3 4 5 |
# File 'lib/garb/destination.rb', line 3 def expression @expression end |
#match_type ⇒ Object (readonly)
Returns the value of attribute match_type.
3 4 5 |
# File 'lib/garb/destination.rb', line 3 def match_type @match_type end |
#steps ⇒ Object (readonly)
Returns the value of attribute steps.
3 4 5 |
# File 'lib/garb/destination.rb', line 3 def steps @steps end |
Instance Method Details
#case_sensitive? ⇒ Boolean
16 17 18 |
# File 'lib/garb/destination.rb', line 16 def case_sensitive? @case_sensitive end |