Add doc for get_institution_name
This commit is contained in:
parent
6e7e644b3a
commit
9f230d5afd
@ -33,7 +33,7 @@ nigel@stanford.edu, bawbag@cs.strath.ac.uk, lee@wunizar.es, terrence@ubishops.ca
|
|||||||
Swot::is_academic?('harvard.edu') # true
|
Swot::is_academic?('harvard.edu') # true
|
||||||
Swot::is_academic?('www.harvard.edu') # true
|
Swot::is_academic?('www.harvard.edu') # true
|
||||||
Swot::is_academic?('http://www.harvard.edu') # true
|
Swot::is_academic?('http://www.harvard.edu') # true
|
||||||
Swot::is_academic?('http://www.kink.com') # false
|
Swot::is_academic?('http://www.github.com') # false
|
||||||
Swot::is_academic?('http://www.rangers.co.uk') # false
|
Swot::is_academic?('http://www.rangers.co.uk') # false
|
||||||
```
|
```
|
||||||
# What is a swot?
|
# What is a swot?
|
||||||
|
|||||||
@ -152,6 +152,9 @@ module Swot
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Figure out the institution name based on the email address/domain.
|
||||||
|
#
|
||||||
|
# Returns a string with the instution name; nil if nothing is found.
|
||||||
def get_institution_name(text)
|
def get_institution_name(text)
|
||||||
text.downcase!
|
text.downcase!
|
||||||
text = text.split("@")[1] if text.include? "@"
|
text = text.split("@")[1] if text.include? "@"
|
||||||
@ -183,7 +186,7 @@ module Swot
|
|||||||
|
|
||||||
# Get the FQDN name from a URL or email address.
|
# Get the FQDN name from a URL or email address.
|
||||||
#
|
#
|
||||||
#
|
# Returns a string with the FQDN; nil if there's an error.
|
||||||
def get_domain(text)
|
def get_domain(text)
|
||||||
return false if text.nil?
|
return false if text.nil?
|
||||||
text.downcase!
|
text.downcase!
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user