Class: Spfquery

Inherits:
Object
  • Object
show all
Defined in:
lib/spfquery.rb,
lib/spfquery/version.rb

Constant Summary collapse

VERSION =
'0.1.0'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ip, sender, helo = nil) ⇒ Spfquery

Returns a new instance of Spfquery.



11
12
13
14
15
# File 'lib/spfquery.rb', line 11

def initialize(ip, sender, helo=nil)
  @ip = ip
  @sender = sender
  @helo = helo
end

Instance Attribute Details

#heloObject (readonly)

Returns the value of attribute helo.



5
6
7
# File 'lib/spfquery.rb', line 5

def helo
  @helo
end

#ipObject (readonly)

Returns the value of attribute ip.



5
6
7
# File 'lib/spfquery.rb', line 5

def ip
  @ip
end

#senderObject (readonly)

Returns the value of attribute sender.



5
6
7
# File 'lib/spfquery.rb', line 5

def sender
  @sender
end

Class Method Details

.pass?(*args) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/spfquery.rb', line 7

def self.pass?(*args)
  new(*args).pass?
end

Instance Method Details

#pass?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/spfquery.rb', line 17

def pass?
  'pass' == result
end

#resultObject



21
22
23
24
25
26
27
28
29
# File 'lib/spfquery.rb', line 21

def result
  @result ||= begin
                if line = output.lines.first
                  line.chomp.downcase
                else
                  'none'
                end
              end
end