Class: Stix2::Identifier
- Inherits:
-
Object
- Object
- Stix2::Identifier
- Defined in:
- lib/stix2/identifier.rb
Instance Method Summary collapse
-
#initialize(value) ⇒ Identifier
constructor
A new instance of Identifier.
- #pretty_print(pp) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(value) ⇒ Identifier
Returns a new instance of Identifier.
3 4 5 6 |
# File 'lib/stix2/identifier.rb', line 3 def initialize(value) value.match(/.*--.*/) || raise("Invalid identifier: #{value}") @value = value end |
Instance Method Details
#pretty_print(pp) ⇒ Object
12 13 14 15 16 |
# File 'lib/stix2/identifier.rb', line 12 def pretty_print(pp) # :nocov: pp.text(@value.inspect) # :nocov end |
#to_s ⇒ Object
8 9 10 |
# File 'lib/stix2/identifier.rb', line 8 def to_s @value end |