Class: ActiveStix::Label

Inherits:
ApplicationRecord show all
Defined in:
app/models/active_stix/label.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.ingest_label(open_vocabulary, label) ⇒ Object



7
8
9
10
11
12
# File 'app/models/active_stix/label.rb', line 7

def self.ingest_label(open_vocabulary, label)

  open_voc = ActiveStix::OpenVocabulary.find_or_create_by(name: open_vocabulary)
  lab = find_or_create_by(open_vocabulary_id: open_voc.id, name: label)
  lab
end

Instance Method Details

#convert_to_jsonObject



14
15
16
# File 'app/models/active_stix/label.rb', line 14

def convert_to_json
  value
end