Class: Epages::Shop

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

Direct Known Subclasses

REST::Shop

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host, name, token = nil, options = { https: true }) ⇒ Shop

Returns a new instance of Shop.



7
8
9
10
11
12
# File 'lib/epages/shop.rb', line 7

def initialize(host, name, token = nil, options = { https: true })
  @host = host
  @name = name
  @token = token
  @protocol = options[:https] ? 'https' : 'http'
end

Instance Attribute Details

#hostObject (readonly)

Returns the value of attribute host.



5
6
7
# File 'lib/epages/shop.rb', line 5

def host
  @host
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/epages/shop.rb', line 5

def name
  @name
end

#protocolObject (readonly)

Returns the value of attribute protocol.



5
6
7
# File 'lib/epages/shop.rb', line 5

def protocol
  @protocol
end

#tokenObject (readonly)

Returns the value of attribute token.



5
6
7
# File 'lib/epages/shop.rb', line 5

def token
  @token
end

Instance Method Details

#shop_nameObject

return the shop name



15
16
17
# File 'lib/epages/shop.rb', line 15

def shop_name
  name
end

#token?Boolean

retuns a boolean indicating if the shop has a token set

Returns:

  • (Boolean)


20
21
22
# File 'lib/epages/shop.rb', line 20

def token?
  !!token
end