Class: Chicago::ETL::StageName Private
- Inherits:
-
Object
- Object
- Chicago::ETL::StageName
- Defined in:
- lib/chicago/etl/stage_name.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
A namespaced name for an ETL stage.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean (also: #==) private
- #hash ⇒ Object private
-
#initialize(*names) ⇒ StageName
constructor
private
A new instance of StageName.
- #match?(*pattern) ⇒ Boolean (also: #=~) private
- #name ⇒ Object private
- #namespace ⇒ Object private
- #to_a ⇒ Object private
- #to_s ⇒ Object private
Constructor Details
#initialize(*names) ⇒ StageName
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of StageName.
7 8 9 10 11 12 13 |
# File 'lib/chicago/etl/stage_name.rb', line 7 def initialize(*names) if names.size == 1 && names.first.kind_of?(String) @names = names.first.split(".").map(&:to_sym).freeze else @names = names.flatten.map(&:to_sym).freeze end end |
Instance Method Details
#eql?(other) ⇒ Boolean Also known as: ==
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
33 34 35 |
# File 'lib/chicago/etl/stage_name.rb', line 33 def eql?(other) to_s == other.to_s end |
#hash ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
38 39 40 |
# File 'lib/chicago/etl/stage_name.rb', line 38 def hash to_s.hash end |
#match?(*pattern) ⇒ Boolean Also known as: =~
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
19 20 21 22 23 24 25 26 |
# File 'lib/chicago/etl/stage_name.rb', line 19 def match?(*pattern) pattern.flatten! return false if pattern.size > @names.size pattern.each_with_index.all? do |part, i| part == :* || @names[i] == part end end |
#name ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
15 16 17 |
# File 'lib/chicago/etl/stage_name.rb', line 15 def name @names.last end |
#namespace ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
29 30 31 |
# File 'lib/chicago/etl/stage_name.rb', line 29 def namespace @names[0...(@names.size - 1)] end |
#to_a ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
42 43 44 |
# File 'lib/chicago/etl/stage_name.rb', line 42 def to_a @names.dup end |
#to_s ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
46 47 48 |
# File 'lib/chicago/etl/stage_name.rb', line 46 def to_s @string_representation ||= @names.join('.') end |