Class: AlchemyLanguage::UrlService
- Inherits:
-
ActiveMethod::Base
- Object
- ActiveMethod::Base
- AlchemyLanguage::UrlService
- Defined in:
- lib/alchemy_language/url_service.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
-
#type ⇒ Object
Returns the value of attribute type.
Attributes inherited from ActiveMethod::Base
Instance Method Summary collapse
- #check_url ⇒ Object
-
#initialize(path) ⇒ UrlService
constructor
A new instance of UrlService.
- #is_url? ⇒ Boolean
Methods inherited from ActiveMethod::Base
authenticate!, authenticate_successfully?, before_request, define_model, json_parser, valid_api_key?
Constructor Details
#initialize(path) ⇒ UrlService
Returns a new instance of UrlService.
27 28 29 30 31 |
# File 'lib/alchemy_language/url_service.rb', line 27 def initialize(path) is_url? @path = path @type = "url" end |
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
3 4 5 |
# File 'lib/alchemy_language/url_service.rb', line 3 def path @path end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/alchemy_language/url_service.rb', line 3 def type @type end |
Instance Method Details
#check_url ⇒ Object
37 38 39 |
# File 'lib/alchemy_language/url_service.rb', line 37 def check_url @path =~ URI::regexp(["ftp", "http", "https"]) end |
#is_url? ⇒ Boolean
33 34 35 |
# File 'lib/alchemy_language/url_service.rb', line 33 def is_url? "params is not url" if check_url.nil? end |