Class: ShopifyURL::Linker

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

Direct Known Subclasses

Admin, Store

Instance Method Summary collapse

Constructor Details

#initialize(shop) ⇒ Linker

Returns a new instance of Linker.

Raises:

  • (ArgumentError)


9
10
11
12
13
14
# File 'lib/shopify_url.rb', line 9

def initialize(shop)
  raise ArgumentError, "shop required" if empty?(shop)

  @host = shop.dup
  @host.prepend("https://") unless @host =~ %r{\Ahttps?://}i
end

Instance Method Details

#to_sObject Also known as: to_str, inspect



16
17
18
# File 'lib/shopify_url.rb', line 16

def to_s
  @host.dup
end