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.
962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 |
# File 'lib/metababel/bt2_trace_class_generator.rb', line 962 def initialize(parent:, options:, selector_field_class: nil) @parent = parent if selector_field_class extend(WithSelectorField) @selector_field_class = selector_field_class = .collect do |o| BTFieldClass::Variant::WithSelectorField::Option.new(name: o[:name], field_class: o[:field_class], range: o[:range]) end else extend(WithoutSelectorField) = .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.
934 935 936 |
# File 'lib/metababel/bt2_trace_class_generator.rb', line 934 def end |