Class: Epages::Shop
- Inherits:
-
Object
- Object
- Epages::Shop
- Defined in:
- lib/epages/shop.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#protocol ⇒ Object
readonly
Returns the value of attribute protocol.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize(host, name, token = nil, options = { https: true }) ⇒ Shop
constructor
A new instance of Shop.
-
#shop_name ⇒ Object
return the shop name.
-
#token? ⇒ Boolean
retuns a boolean indicating if the shop has a token set.
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, = { https: true }) @host = host @name = name @token = token @protocol = [:https] ? 'https' : 'http' end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
5 6 7 |
# File 'lib/epages/shop.rb', line 5 def host @host end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/epages/shop.rb', line 5 def name @name end |
#protocol ⇒ Object (readonly)
Returns the value of attribute protocol.
5 6 7 |
# File 'lib/epages/shop.rb', line 5 def protocol @protocol end |
#token ⇒ Object (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_name ⇒ Object
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
20 21 22 |
# File 'lib/epages/shop.rb', line 20 def token? !!token end |