Module: Alt::URI::Builders
Instance Method Summary collapse
- #create(hash = nil) ⇒ Object
- #create_(hash) ⇒ Object
- #parse(str) ⇒ Object
- #parse_(str) {|u| ... } ⇒ Object
Instance Method Details
#create(hash = nil) ⇒ Object
28 29 30 31 |
# File 'lib/rio/alturi.rb', line 28 def create(hash=nil) hash ||= Hash.new create_(hash) end |
#create_(hash) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/rio/alturi.rb', line 19 def create_(hash) u = self.new hash.each do |k,v| sym = (k.to_s+?=).to_sym u.__send__(sym,v) end u end |
#parse(str) ⇒ Object
15 16 17 |
# File 'lib/rio/alturi.rb', line 15 def parse(str) parse_(str) end |
#parse_(str) {|u| ... } ⇒ Object
8 9 10 11 12 13 |
# File 'lib/rio/alturi.rb', line 8 def parse_(str,&block) u = self.new u.uri = str yield u if block_given? u end |