Module: CVESchema::CVE::HasLangValue

Included in:
Configuration, Credit, Description, Exploit, Solution, Timeline, WorkAround
Defined in:
lib/cve_schema/cve/has_lang_value.rb

Overview

Mixins for JSON objects containing "lang" and "value" keys.

Defined Under Namespace

Modules: ClassMethods

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#lang:en, ... (readonly)

Language identifier for #value.

Returns:

  • (:en, :es, String)


62
63
64
# File 'lib/cve_schema/cve/has_lang_value.rb', line 62

def lang
  @lang
end

#valueString (readonly)

Text value.

Returns:

  • (String)


67
68
69
# File 'lib/cve_schema/cve/has_lang_value.rb', line 67

def value
  @value
end

Class Method Details

.included(base) ⇒ Object

Adds ClassMethods to the class.

Parameters:



16
17
18
# File 'lib/cve_schema/cve/has_lang_value.rb', line 16

def self.included(base)
  base.extend ClassMethods
end

Instance Method Details

#initialize(lang:, value:) ⇒ Object

Initializes #lang and #value.

Parameters:

  • lang (:en, :es, String)
  • value (String)


76
77
78
79
# File 'lib/cve_schema/cve/has_lang_value.rb', line 76

def initialize(lang: , value: )
  @lang  = lang
  @value = value
end

#to_sString

Converts the object to a String.

Returns:

  • (String)

    Returns the #value.



87
88
89
# File 'lib/cve_schema/cve/has_lang_value.rb', line 87

def to_s
  @value
end