Class: Bulkdom::DomainList
- Inherits:
-
Object
- Object
- Bulkdom::DomainList
- Defined in:
- lib/bulkdom/domain_list.rb
Instance Attribute Summary collapse
-
#list ⇒ Object
Returns the value of attribute list.
-
#processed ⇒ Object
Returns the value of attribute processed.
-
#results ⇒ Object
Returns the value of attribute results.
-
#tlds ⇒ Object
Returns the value of attribute tlds.
Instance Method Summary collapse
-
#initialize ⇒ DomainList
constructor
A new instance of DomainList.
- #process ⇒ Object
- #return_available(tld) ⇒ Object
Constructor Details
#initialize ⇒ DomainList
Returns a new instance of DomainList.
5 6 7 8 |
# File 'lib/bulkdom/domain_list.rb', line 5 def initialize() @list, @tlds = ["example"], [".com"] @processed = false end |
Instance Attribute Details
#list ⇒ Object
Returns the value of attribute list.
3 4 5 |
# File 'lib/bulkdom/domain_list.rb', line 3 def list @list end |
#processed ⇒ Object
Returns the value of attribute processed.
3 4 5 |
# File 'lib/bulkdom/domain_list.rb', line 3 def processed @processed end |
#results ⇒ Object
Returns the value of attribute results.
3 4 5 |
# File 'lib/bulkdom/domain_list.rb', line 3 def results @results end |
#tlds ⇒ Object
Returns the value of attribute tlds.
3 4 5 |
# File 'lib/bulkdom/domain_list.rb', line 3 def tlds @tlds end |
Instance Method Details
#process ⇒ Object
10 11 12 13 |
# File 'lib/bulkdom/domain_list.rb', line 10 def process self.results = whois_check(dns_record_check(generate_results_hash(self.list, self.tlds), self.tlds), self.tlds) self.processed = true end |
#return_available(tld) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/bulkdom/domain_list.rb', line 15 def return_available(tld) process unless self.processed available_domains = [] self.results.each do |i| available_domains << "#{i[:domain]}#{tld}" if i[:tlds]["#{tld.split('.')[1]}_available"] == "y" end return available_domains end |