Class: URI::Generic
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
- #add_query(arg) ⇒ Object
- #checkout ⇒ Object
- #commit(*args) ⇒ Object
- #mk_custom_opts ⇒ Object
- #pathname ⇒ Object
- #pathname=(path) ⇒ Object
- #save ⇒ Object
- #to_uri ⇒ Object (also: #to_url)
- #to_yaml_string ⇒ Object
Class Method Details
Instance Method Details
#add_query(arg) ⇒ Object
70 71 72 73 74 75 76 |
# File 'lib/uri/generic_ex.rb', line 70 def add_query ( arg ) if query.nil? self.query = arg else self.query += ',' + arg end end |
#checkout ⇒ Object
58 59 60 |
# File 'lib/uri/generic_ex.rb', line 58 def checkout raise CheckoutError, "Can't checkout a #{self.class}" end |
#commit(*args) ⇒ Object
62 63 64 |
# File 'lib/uri/generic_ex.rb', line 62 def commit ( *args ) raise CommitError, "Can't commit a #{self.class}" end |
#mk_custom_opts ⇒ Object
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/uri/generic_ex.rb', line 79 def mk_custom_opts opts = [] return opts if @query.nil? @query.split(/,/).map do |x| k, v = x.split(/=/) k = URI.decode(k) if k.size == 1 opts << "-#{k}" else opts << "--#{k}" end opts << URI.decode(v) unless v.nil? end opts end |
#pathname ⇒ Object
41 42 43 |
# File 'lib/uri/generic_ex.rb', line 41 def pathname Pathname.new(path) end |
#pathname=(path) ⇒ Object
45 46 47 |
# File 'lib/uri/generic_ex.rb', line 45 def pathname= ( path ) self.path = path.to_s end |
#save ⇒ Object
66 67 68 |
# File 'lib/uri/generic_ex.rb', line 66 def save raise SaveError, "Can't save a #{self.class}" end |
#to_uri ⇒ Object Also known as: to_url
53 54 55 |
# File 'lib/uri/generic_ex.rb', line 53 def to_uri self end |
#to_yaml_string ⇒ Object
49 50 51 |
# File 'lib/uri/generic_ex.rb', line 49 def to_yaml_string to_s end |