Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/actn/core_ext/string.rb
Instance Method Summary collapse
Instance Method Details
#as_json ⇒ Object
7 8 9 |
# File 'lib/actn/core_ext/string.rb', line 7 def as_json Oj.load(self) end |
#to_domain ⇒ Object
10 11 12 13 |
# File 'lib/actn/core_ext/string.rb', line 10 def to_domain return self unless self.start_with?("http") self.match(/[http|http]:\/\/(\w*:\d*|\w*)\/?/)[1] rescue nil end |
#to_json ⇒ Object
4 5 6 |
# File 'lib/actn/core_ext/string.rb', line 4 def to_json self end |