Method: Wgit::Url#to_h
- Defined in:
- lib/wgit/url.rb
#to_h ⇒ Hash
Returns a Hash containing this Url's instance vars excluding @uri. Used when storing the URL in a Database e.g. MongoDB etc.
366 367 368 369 |
# File 'lib/wgit/url.rb', line 366 def to_h h = Wgit::Utils.to_h(self, ignore: ["@uri"]) Hash[h.to_a.insert(0, ["url", to_s])] # Insert url at position 0. end |