class SwiftGenerator::SwiftNonPrimitive
Base class for Struct, Enum and Class
Attributes
access_control_modifiers[RW]
class_characteristics[RW]
definition_set[RW]
file_name[RW]
inheritance_list[RW]
initializers[RW]
is_test_element[RW]
is_user_editable[RW]
methods[RW]
properties[RW]
source_file[RW]
specified_type_name[RW]
top_inner_comment_block[RW]
type_name[RW]
Public Class Methods
new( definition_set, specified_type_name, inheritance_list=[], type_name:nil, file_name: nil, characteristics:[], is_user_editable: false, is_test_element: false )
click to toggle source
# File lib/swift_generator/code_generation/swift_class_generation.rb, line 81 def initialize( definition_set, specified_type_name, inheritance_list=[], type_name:nil, file_name: nil, characteristics:[], is_user_editable: false, is_test_element: false ) @definition_set = definition_set @specified_type_name = specified_type_name @inheritance_list = inheritance_list @type_name = type_name.nil? ? specified_type_name : type_name @file_name = file_name #@access_control_modifier = 'public ' @access_control_modifiers = [] @class_characteristics = [* characteristics] @is_user_editable = is_user_editable @is_test_element = is_test_element @methods = [] @initializers = [] @properties = [] @post_super_initializations = {} @top_inner_comment_block = [] # This class will now be added to the definition set and its source file # The source file will be created if needed. @definition_set.add_element(self) # Source file is now set @source_file.add_import('Foundation') end
Public Instance Methods
comparable_properties()
click to toggle source
# File lib/swift_generator/code_generation/swift_class_generation.rb, line 119 def comparable_properties() persistent_properties end
make_property_type()
click to toggle source
# File lib/swift_generator/code_generation/swift_class_generation.rb, line 133 def make_property_type; raise $UNIMPLEMENTED; end
persistent_properties()
click to toggle source
# File lib/swift_generator/code_generation/swift_class_generation.rb, line 115 def persistent_properties() @properties.select { |prop| prop.is_persistent } end
prepare_for_generation()
click to toggle source
# File lib/swift_generator/code_generation/swift_class_generation.rb, line 135 def prepare_for_generation; raise $UNIMPLEMENTED; end
prepare_supporting_elements()
click to toggle source
# File lib/swift_generator/code_generation/swift_class_generation.rb, line 134 def prepare_supporting_elements; raise $UNIMPLEMENTED; end
resolve_property_types()
click to toggle source
# File lib/swift_generator/code_generation/swift_class_generation.rb, line 123 def resolve_property_types() @properties.each do |property| property.resolve_type end end
swift_type_symbol()
click to toggle source
# File lib/swift_generator/code_generation/swift_class_generation.rb, line 129 def swift_type_symbol return @type_name.to_sym end
transient_properties()
click to toggle source
# File lib/swift_generator/code_generation/swift_class_generation.rb, line 111 def transient_properties() @properties.select { |prop| !prop.is_persistent } end