Class: Stix2::MetaObject::DataMarking::ObjectMarking

Inherits:
Object
  • Object
show all
Defined in:
lib/stix2/meta_objects/data_markings/object_marking.rb

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ ObjectMarking

Returns a new instance of ObjectMarking.



5
6
7
8
# File 'lib/stix2/meta_objects/data_markings/object_marking.rb', line 5

def initialize(value)
  value.match(/marking-definition--.*/) || raise("Invalid value: #{value}")
  @value = value
end

Instance Method Details

#pretty_print(pp) ⇒ Object



14
15
16
17
18
# File 'lib/stix2/meta_objects/data_markings/object_marking.rb', line 14

def pretty_print(pp)
  # :nocov:
  pp.text(@value.inspect)
  # :nocov
end

#to_sObject



10
11
12
# File 'lib/stix2/meta_objects/data_markings/object_marking.rb', line 10

def to_s
  @value
end