Class: SPF::Query::IP
- Inherits:
-
Object
- Object
- SPF::Query::IP
- Defined in:
- lib/spf/query/ip.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#cidr_length ⇒ Object
readonly
Returns the value of attribute cidr_length.
Instance Method Summary collapse
-
#initialize(address, cidr_length = nil) ⇒ IP
constructor
A new instance of IP.
- #to_s ⇒ Object
Constructor Details
#initialize(address, cidr_length = nil) ⇒ IP
Returns a new instance of IP.
9 10 11 12 |
# File 'lib/spf/query/ip.rb', line 9 def initialize(address,cidr_length=nil) @address = address @cidr_length = cidr_length end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
5 6 7 |
# File 'lib/spf/query/ip.rb', line 5 def address @address end |
#cidr_length ⇒ Object (readonly)
Returns the value of attribute cidr_length.
7 8 9 |
# File 'lib/spf/query/ip.rb', line 7 def cidr_length @cidr_length end |
Instance Method Details
#to_s ⇒ Object
14 15 16 17 18 |
# File 'lib/spf/query/ip.rb', line 14 def to_s if @cidr_length then "#{@address}/#{@cidr_length}" else "#{@address}" end end |