Class: RASN1::Model::Elem
- Inherits:
-
Struct
- Object
- Struct
- RASN1::Model::Elem
- Defined in:
- lib/rasn1/model.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#name ⇒ Object
Returns the value of attribute name.
-
#proc_or_class ⇒ Object
Returns the value of attribute proc_or_class.
Instance Method Summary collapse
-
#initialize(name, proc_or_class, content) ⇒ Elem
constructor
A new instance of Elem.
Constructor Details
#initialize(name, proc_or_class, content) ⇒ Elem
Returns a new instance of Elem.
72 73 74 75 76 77 78 79 |
# File 'lib/rasn1/model.rb', line 72 def initialize(name, proc_or_class, content) if content.is_a?(Array) duplicate_names = find_all_duplicate_names(content.map(&:name) + [name]) raise ModelValidationError, "Duplicate name #{duplicate_names.first} found" if duplicate_names.any? end super end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content
68 69 70 |
# File 'lib/rasn1/model.rb', line 68 def content @content end |
#name ⇒ Object
Returns the value of attribute name
68 69 70 |
# File 'lib/rasn1/model.rb', line 68 def name @name end |
#proc_or_class ⇒ Object
Returns the value of attribute proc_or_class
68 69 70 |
# File 'lib/rasn1/model.rb', line 68 def proc_or_class @proc_or_class end |