Class: CheckDomain::Domain
- Inherits:
-
Object
- Object
- CheckDomain::Domain
- Defined in:
- lib/checkdomain/domain.rb
Instance Attribute Summary collapse
-
#available ⇒ Object
Returns the value of attribute available.
-
#message ⇒ Object
Returns the value of attribute message.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #availability! ⇒ Object
-
#initialize(options = {:name => nil}) ⇒ Domain
constructor
A new instance of Domain.
Constructor Details
#initialize(options = {:name => nil}) ⇒ Domain
Returns a new instance of Domain.
7 8 9 |
# File 'lib/checkdomain/domain.rb', line 7 def initialize( = {:name => nil}) self.name = [:name] end |
Instance Attribute Details
#available ⇒ Object
Returns the value of attribute available.
4 5 6 |
# File 'lib/checkdomain/domain.rb', line 4 def available @available end |
#message ⇒ Object
Returns the value of attribute message.
5 6 7 |
# File 'lib/checkdomain/domain.rb', line 5 def @message end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/checkdomain/domain.rb', line 3 def name @name end |
Instance Method Details
#availability! ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/checkdomain/domain.rb', line 11 def availability! if !(self.name =~ REGEX_DOMAIN) then is_invalid else if (nx_domain? || opendns_nxdomain?) if whois_match? then is_taken else is_available end else is_taken end end end |