Class: Podjumper::JumpInfo
- Inherits:
-
Struct
- Object
- Struct
- Podjumper::JumpInfo
- Defined in:
- lib/podjumper/jump_info.rb
Instance Attribute Summary collapse
-
#container_name ⇒ Object
Returns the value of attribute container_name.
-
#namespace ⇒ Object
Returns the value of attribute namespace.
-
#pod ⇒ Object
Returns the value of attribute pod.
Class Method Summary collapse
- .load(args) ⇒ Object
- .load_rails_from_subdomain(subdomain) ⇒ Object
- .load_upto_namespace(args) ⇒ Object
- .load_upto_pod(args) ⇒ Object
Instance Method Summary collapse
Instance Attribute Details
#container_name ⇒ Object
Returns the value of attribute container_name
4 5 6 |
# File 'lib/podjumper/jump_info.rb', line 4 def container_name @container_name end |
#namespace ⇒ Object
Returns the value of attribute namespace
4 5 6 |
# File 'lib/podjumper/jump_info.rb', line 4 def namespace @namespace end |
#pod ⇒ Object
Returns the value of attribute pod
4 5 6 |
# File 'lib/podjumper/jump_info.rb', line 4 def pod @pod end |
Class Method Details
.load(args) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/podjumper/jump_info.rb', line 15 def load(args) args = args.dup namespace = disambiguate_namespace(args.shift) pod = disambiguate_pod(namespace, args.shift) container = disambiguate_container(pod, args.shift) new(namespace, pod, container) end |
.load_rails_from_subdomain(subdomain) ⇒ Object
39 40 41 42 |
# File 'lib/podjumper/jump_info.rb', line 39 def load_rails_from_subdomain(subdomain) pod = Pod.where(subdomain: subdomain).first new(pod.namespace, pod, pod.container('rails')) end |
.load_upto_namespace(args) ⇒ Object
32 33 34 35 36 37 |
# File 'lib/podjumper/jump_info.rb', line 32 def load_upto_namespace(args) args = args.dup namespace = disambiguate_namespace(args.shift) new(namespace, nil, nil) end |
.load_upto_pod(args) ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/podjumper/jump_info.rb', line 24 def load_upto_pod(args) args = args.dup namespace = disambiguate_namespace(args.shift) pod = disambiguate_pod(namespace, args.shift) new(namespace, pod, nil) end |
Instance Method Details
#pod_name ⇒ Object
9 10 11 |
# File 'lib/podjumper/jump_info.rb', line 9 def pod_name pod&.name end |
#subdomain ⇒ Object
5 6 7 |
# File 'lib/podjumper/jump_info.rb', line 5 def subdomain pod&.subdomain end |