Class: AlexaRuby::URI

Inherits:
Object
  • Object
show all
Defined in:
lib/alexa_ruby/request/base_request/validator/uri.rb

Overview

URI request validator

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri) ⇒ URI

Setup new URI

Parameters:

  • uri (String)

    URI



9
10
11
# File 'lib/alexa_ruby/request/base_request/validator/uri.rb', line 9

def initialize(uri)
  @uri = Addressable::URI.parse(uri).normalize!
end

Instance Attribute Details

#uriObject (readonly)

Returns the value of attribute uri.



4
5
6
# File 'lib/alexa_ruby/request/base_request/validator/uri.rb', line 4

def uri
  @uri
end

Instance Method Details

#valid?Boolean

Check if it is a valid Amazon URI

Returns:

  • (Boolean)


16
17
18
# File 'lib/alexa_ruby/request/base_request/validator/uri.rb', line 16

def valid?
  https? && amazon? && echo_api? && port?
end