Class: Slash3D::Iframe
- Inherits:
-
Object
- Object
- Slash3D::Iframe
- Defined in:
- lib/slash3d/iframe.rb
Overview
Represent an Iframe to build a model with 3D Slash
Constant Summary collapse
- LANGUAGES =
{ 'en' => 0, 'fr' => 1 }
Instance Method Summary collapse
- #content_id ⇒ Object
-
#initialize(content_id: nil, source: nil, redirect_url: nil, lang: nil) ⇒ Iframe
constructor
A new instance of Iframe.
- #url ⇒ Object
Constructor Details
#initialize(content_id: nil, source: nil, redirect_url: nil, lang: nil) ⇒ Iframe
12 13 14 15 16 17 18 19 20 |
# File 'lib/slash3d/iframe.rb', line 12 def initialize(content_id: nil, source: nil, redirect_url: nil, lang: nil) @content_id = content_id @source = source @redirect_url = redirect_url @lang = lang end |
Instance Method Details
#content_id ⇒ Object
22 23 24 |
# File 'lib/slash3d/iframe.rb', line 22 def content_id @content_id ||= SecureRandom.hex(32) end |
#url ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/slash3d/iframe.rb', line 26 def url parameters = { partner: Slash3D.configuration.partner_code, content: content_id, src: source, redirect: redirect_url, sign: signature, lang: lang_number, } "https://www.3dslash.net/slash.php?" + parameters.to_query end |