|
|
IronRuby > Documentation > .NET Integration > Enums
EnumsFrom $1Table of contentsNo headersEnums map onto Ruby classes, so using them is just like using any .NET class: >>> require 'System.Windows.Forms' => true >>> include System::Windows::Forms => Object >>> AnchorStyles => System::Windows::Forms::AnchorStyles >>> System::Enum.GetNames(AnchorStyles.to_clr_type) => ['None', 'Top', 'Bottom', 'Left', 'Right'] >>> AnchorStyles.bottom => Bottom They can also be xor'd together >>> AnchorStyles.bottom | AnchorStyles.left => Bottom, Left Note: make sure not to use the "or" operator (||), as that will only give you back the first Enum value
Tags:
|