summaryrefslogtreecommitdiff
path: root/qa/qa/runtime/address.rb
blob: ffad3974b02e58179109816ca0e43a0b5c1f511b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
module QA
  module Runtime
    class Address
      attr_reader :address

      def initialize(instance, page = nil)
        @instance = instance
        @address  = host + (page.is_a?(String) ? page : page&.path)
      end

      def host
        if @instance.is_a?(Symbol)
          Runtime::Scenario.send("#{@instance}_address")
        else
          @instance.to_s
        end
      end
    end
  end
end