Class: Boutons::URI

Inherits:
Object
  • Object
show all
Defined in:
lib/boutons/uri.rb

Defined Under Namespace

Classes: Registry

Instance Method Summary collapse

Constructor Details

#initialize(uri) ⇒ URI



72
73
74
75
# File 'lib/boutons/uri.rb', line 72

def initialize uri
  uri = ::URI.escape uri
  @uri ||= URI(uri)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object (private)



91
92
93
# File 'lib/boutons/uri.rb', line 91

def method_missing method, *args, &block
  @uri.send method, *args, &block
end

Instance Method Details

#check_uriObject



87
88
89
# File 'lib/boutons/uri.rb', line 87

def check_uri
  ::URI.unescape(@uri.path).split("#",2)[1] || "/"
end

#modeObject



79
80
# File 'lib/boutons/uri.rb', line 79

def mode
end

#registryObject



76
77
78
# File 'lib/boutons/uri.rb', line 76

def registry
  @registry ||= Registry.new @uri
end

#typeObject



81
82
83
# File 'lib/boutons/uri.rb', line 81

def type
  @uri.scheme
end