Class: Symbol

Inherits:
Object
  • Object
show all
Defined in:
lib/core_ext/symbol.rb

Instance Method Summary collapse

Instance Method Details

#to_camelized_sObject



2
3
4
# File 'lib/core_ext/symbol.rb', line 2

def to_camelized_s
  self.to_s.split('_').map(&:capitalize).join(' ')
end

#to_control_typeObject



15
16
17
# File 'lib/core_ext/symbol.rb', line 15

def to_control_type
  Uia::ControlTypes.const_get_path "#{self.capitalize}"
end

#to_control_type_constObject



19
20
21
22
23
# File 'lib/core_ext/symbol.rb', line 19

def to_control_type_const
  control_type = Uia::Library::Constants::ControlTypes[self]
  raise Uia::InvalidControlType.new(self) unless control_type
  control_type
end

#to_pattern_available_propertyObject



6
7
8
# File 'lib/core_ext/symbol.rb', line 6

def to_pattern_available_property
  "Is#{self.to_camelized_s.delete(' ')}PatternAvailableProperty"
end

#to_pattern_constObject

:selection_item => Uia::Patterns::SelectionItem



11
12
13
# File 'lib/core_ext/symbol.rb', line 11

def to_pattern_const
  Uia::Patterns.const_get_path "#{self.capitalize}"
end