Class: ProductTours::VideoResolver::Result

Inherits:
Data
  • Object
show all
Defined in:
lib/product_tours/video_resolver.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#kindObject (readonly)

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



7
8
9
# File 'lib/product_tours/video_resolver.rb', line 7

def kind
  @kind
end

#providerObject (readonly)

Returns the value of attribute provider

Returns:

  • (Object)

    the current value of provider



7
8
9
# File 'lib/product_tours/video_resolver.rb', line 7

def provider
  @provider
end

#provider_idObject (readonly)

Returns the value of attribute provider_id

Returns:

  • (Object)

    the current value of provider_id



7
8
9
# File 'lib/product_tours/video_resolver.rb', line 7

def provider_id
  @provider_id
end

#urlObject (readonly)

Returns the value of attribute url

Returns:

  • (Object)

    the current value of url



7
8
9
# File 'lib/product_tours/video_resolver.rb', line 7

def url
  @url
end

Instance Method Details

#direct?Boolean

Returns:

  • (Boolean)


9
# File 'lib/product_tours/video_resolver.rb', line 9

def direct? = kind == 'direct'

#iframe?Boolean

Returns:

  • (Boolean)


8
# File 'lib/product_tours/video_resolver.rb', line 8

def iframe? = kind == 'iframe'

#metadataObject



11
12
13
14
15
16
17
# File 'lib/product_tours/video_resolver.rb', line 11

def 
  {
    'provider' => provider,
    'provider_id' => provider_id,
    'embed_url' => iframe? ? url : nil
  }.compact
end