Class: OTX::Indicator::IP::Reputation

Inherits:
Type::Base
  • Object
show all
Defined in:
lib/otx_ruby/types/ip/reputation.rb

Instance Attribute Summary collapse

Attributes inherited from Type::Base

#created, #modified

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Reputation

Returns a new instance of Reputation.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/otx_ruby/types/ip/reputation.rb', line 16

def initialize(attributes={})
  attributes.each do |key, value|
    _key = key.gsub('-', '_')

    unless self.respond_to?(_key.downcase)
      self.class.send(:attr_accessor, _key.downcase)
    end

    if _key != 'activities'
      send("#{_key.downcase}=", value)
    else
      @activities = []
      value.each do |activity|
        @activities << OTX::Indicator::Activity.new(activity)
      end
    end
  end
end

Instance Attribute Details

#activities ⇒ Object

Needs details for attributes



8
9
10
# File 'lib/otx_ruby/types/ip/reputation.rb', line 8

def activities
  @activities
end

#address ⇒ Object

Needs details for attributes



8
9
10
# File 'lib/otx_ruby/types/ip/reputation.rb', line 8

def address
  @address
end

#allow_ping ⇒ Object

Needs details for attributes



8
9
10
# File 'lib/otx_ruby/types/ip/reputation.rb', line 8

def allow_ping
  @allow_ping
end

#as ⇒ Object

Needs details for attributes



8
9
10
# File 'lib/otx_ruby/types/ip/reputation.rb', line 8

def as
  @as
end

#city ⇒ Object

Needs details for attributes



8
9
10
# File 'lib/otx_ruby/types/ip/reputation.rb', line 8

def city
  @city
end

#country ⇒ Object

Needs details for attributes



8
9
10
# File 'lib/otx_ruby/types/ip/reputation.rb', line 8

def country
  @country
end

#counts ⇒ Object

Needs details for attributes



8
9
10
# File 'lib/otx_ruby/types/ip/reputation.rb', line 8

def counts
  @counts
end

#date_added ⇒ Object

Needs details for attributes



8
9
10
# File 'lib/otx_ruby/types/ip/reputation.rb', line 8

def date_added
  @date_added
end

#domains ⇒ Object

Needs details for attributes



8
9
10
# File 'lib/otx_ruby/types/ip/reputation.rb', line 8

def domains
  @domains
end

#first_seen ⇒ Object

Needs details for attributes



8
9
10
# File 'lib/otx_ruby/types/ip/reputation.rb', line 8

def first_seen
  @first_seen
end

#id ⇒ Object

Needs details for attributes



8
9
10
# File 'lib/otx_ruby/types/ip/reputation.rb', line 8

def id
  @id
end

#last_seen ⇒ Object

Needs details for attributes



8
9
10
# File 'lib/otx_ruby/types/ip/reputation.rb', line 8

def last_seen
  @last_seen
end

#lat ⇒ Object

Needs details for attributes



8
9
10
# File 'lib/otx_ruby/types/ip/reputation.rb', line 8

def lat
  @lat
end

#lon ⇒ Object

Needs details for attributes



8
9
10
# File 'lib/otx_ruby/types/ip/reputation.rb', line 8

def lon
  @lon
end

#matched_bl ⇒ Object

Needs details for attributes



8
9
10
# File 'lib/otx_ruby/types/ip/reputation.rb', line 8

def matched_bl
  @matched_bl
end

#matched_wl ⇒ Object

Needs details for attributes



8
9
10
# File 'lib/otx_ruby/types/ip/reputation.rb', line 8

def matched_wl
  @matched_wl
end

#organization ⇒ Object

Needs details for attributes



8
9
10
# File 'lib/otx_ruby/types/ip/reputation.rb', line 8

def organization
  @organization
end

#reputation_rel ⇒ Object

Needs details for attributes



8
9
10
# File 'lib/otx_ruby/types/ip/reputation.rb', line 8

def reputation_rel
  @reputation_rel
end

#reputation_rel_checked ⇒ Object

Needs details for attributes



8
9
10
# File 'lib/otx_ruby/types/ip/reputation.rb', line 8

def reputation_rel_checked
  @reputation_rel_checked
end

#reputation_val ⇒ Object

Needs details for attributes



8
9
10
# File 'lib/otx_ruby/types/ip/reputation.rb', line 8

def reputation_val
  @reputation_val
end

#reputation_val_checked ⇒ Object

Needs details for attributes



8
9
10
# File 'lib/otx_ruby/types/ip/reputation.rb', line 8

def reputation_val_checked
  @reputation_val_checked
end

#server_type ⇒ Object

Needs details for attributes



8
9
10
# File 'lib/otx_ruby/types/ip/reputation.rb', line 8

def server_type
  @server_type
end

#state ⇒ Object

Needs details for attributes



8
9
10
# File 'lib/otx_ruby/types/ip/reputation.rb', line 8

def state
  @state
end

#status ⇒ Object

Needs details for attributes



8
9
10
# File 'lib/otx_ruby/types/ip/reputation.rb', line 8

def status
  @status
end

#threat_score ⇒ Object

Needs details for attributes



8
9
10
# File 'lib/otx_ruby/types/ip/reputation.rb', line 8

def threat_score
  @threat_score
end

#up ⇒ Object

Needs details for attributes



8
9
10
# File 'lib/otx_ruby/types/ip/reputation.rb', line 8

def up
  @up
end

Instance Method Details

#_id=(id) ⇒ Object



12
13
14
# File 'lib/otx_ruby/types/ip/reputation.rb', line 12

def _id=(id)
  @id = id['$id']
end