Skip to content

Commit

Permalink
Added OSMatch#line.
Browse files Browse the repository at this point in the history
  • Loading branch information
postmodern committed Jan 25, 2024
1 parent 1102182 commit dbaff0c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/nmap/xml/os_match.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ def accuracy
@accuracy ||= @node['accuracy'].to_i
end

#
# The `line` attribute.
#
# @return [Integer]
#
# @since 1.1.0
#
def line
@line ||= @node['line'].to_i
end

#
# The OS matches OS class.
#
Expand Down
6 changes: 6 additions & 0 deletions spec/xml/os_match_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
end
end

describe "#line" do
it "must return the parsed line attribute" do
expect(subject.line).to eq(48063)
end
end

describe "#os_class" do
it "must return a Nmap::XML::OSClass object" do
expect(subject.os_class).to be_kind_of(Nmap::XML::OSClass)
Expand Down

0 comments on commit dbaff0c

Please sign in to comment.