Module: NetworkExecutive::Components::PhotoPlayer

Defined in:
lib/network_executive/components/photo_player.rb

Instance Method Summary collapse

Instance Method Details

#feedObject



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/network_executive/components/photo_player.rb', line 29

def feed
  _url = URI.parse( feed_url )
  http = Net::HTTP.new( _url.host, _url.port )

  if _url.scheme == 'https'
    http.use_ssl     = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
  end

  request  = Net::HTTP::Get.new( _url.request_uri )
  response = http.request( request )

  JSON.parse response.body
rescue StandardError
  {}
end

#feed_urlObject

Raises:

  • (NotImplementedError)


21
22
23
# File 'lib/network_executive/components/photo_player.rb', line 21

def feed_url
  raise NotImplementedError
end

#onloadObject



15
16
17
18
19
# File 'lib/network_executive/components/photo_player.rb', line 15

def onload
  {
    photos: photos
  }
end

#photosObject



25
26
27
# File 'lib/network_executive/components/photo_player.rb', line 25

def photos
  []
end

#refreshObject



11
12
13
# File 'lib/network_executive/components/photo_player.rb', line 11

def refresh
  false
end

#urlObject



7
8
9
# File 'lib/network_executive/components/photo_player.rb', line 7

def url
  NetworkExecutive::Engine.routes.url_helpers.slideshow_path
end