Class: Babeltrace2Gen::BTFieldClass::Variant
- Inherits:
-
Babeltrace2Gen::BTFieldClass
- Object
- Babeltrace2Gen::BTFieldClass
- Babeltrace2Gen::BTFieldClass::Variant
- Extended by:
- Babeltrace2Gen::BTFromH
- Defined in:
- lib/metababel/bt2_trace_class_generator.rb
Defined Under Namespace
Modules: WithSelectorField, WithoutSelectorField Classes: Option
Constant Summary
Constants inherited from Babeltrace2Gen::BTFieldClass
Constants included from Babeltrace2Gen::BTPrinter
Babeltrace2Gen::BTPrinter::INDENT_INCREMENT
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Attributes inherited from Babeltrace2Gen::BTFieldClass
#cast_type, #cast_type_is_struct, #type
Attributes included from Babeltrace2Gen::BTLocator
Instance Method Summary collapse
-
#initialize(parent:, options:, selector_field_class: nil) ⇒ Variant
constructor
A new instance of Variant.
Methods included from Babeltrace2Gen::BTFromH
Methods inherited from Babeltrace2Gen::BTFieldClass
#bt_get_variable, from_h, #get_declarator, #get_getter, #get_setter
Methods included from Babeltrace2Gen::BTMatch
Methods included from Babeltrace2Gen::BTPrinter
context, #name_sanitized, pr, #scope
Methods included from Babeltrace2Gen::BTLocator
#rec_event_class, #rec_member_class, #rec_stream_class, #rec_trace_class, #resolve_path
Constructor Details
#initialize(parent:, options:, selector_field_class: nil) ⇒ Variant
Returns a new instance of Variant.
952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 |
# File 'lib/metababel/bt2_trace_class_generator.rb', line 952 def initialize(parent:, options:, selector_field_class: nil) @parent = parent if selector_field_class extend(WithSelectorField) @selector_field_class = selector_field_class @options = .collect do |o| BTFieldClass::Variant::WithSelectorField::Option.new(name: o[:name], field_class: o[:field_class], range: o[:range]) end else extend(WithoutSelectorField) @options = .collect do |o| BTFieldClass::Variant::Option.new(name: o[:name], field_class: o[:field_class]) end end end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
924 925 926 |
# File 'lib/metababel/bt2_trace_class_generator.rb', line 924 def @options end |