Class: FunFX::Meta::FlexMetaClass

Inherits:
MetaClass
  • Object
show all
Defined in:
lib/funfx/meta/parser.rb

Instance Attribute Summary

Attributes inherited from MetaClass

#children

Instance Method Summary collapse

Methods inherited from MetaClass

#add_children_recursive

Constructor Details

#initialize(class_info) ⇒ FlexMetaClass

Returns a new instance of FlexMetaClass.



66
67
68
69
# File 'lib/funfx/meta/parser.rb', line 66

def initialize(class_info)
  super()
  @class_info = class_info
end

Instance Method Details

#dot_event_listObject



108
109
110
111
# File 'lib/funfx/meta/parser.rb', line 108

def dot_event_list
  l = events.map{|e| e.to_method.gsub(/"/, '\"')}.join('\l')
  l == "" ? l : "#{l}\\l"
end

#dot_property_listObject



103
104
105
106
# File 'lib/funfx/meta/parser.rb', line 103

def dot_property_list
  l = properties.map{|p| p.to_dot}.join('\l')
  l == "" ? l : "#{l}\\l"
end

#eventsObject



93
94
95
96
97
# File 'lib/funfx/meta/parser.rb', line 93

def events
  @class_info.find('Events/Event').map do |event|
    Event.new(event)
  end
end


71
72
73
74
75
76
77
# File 'lib/funfx/meta/parser.rb', line 71

def link_with(lib)
  s = lib[superclass_name]
  unless s.nil?
    @superclass = s
    @superclass.children << self
  end
end

#lookup_methodObject



113
114
115
# File 'lib/funfx/meta/parser.rb', line 113

def lookup_method
  name.underscore.gsub(/^flex_/, '')
end

#nameObject



79
80
81
# File 'lib/funfx/meta/parser.rb', line 79

def name
  @class_info['Name']
end

#propertiesObject



87
88
89
90
91
# File 'lib/funfx/meta/parser.rb', line 87

def properties
  @class_info.find('Properties/Property').map do |property|
    ['columnNames'].include?(property['Name']) ? nil : Property.new(property, false)
  end.compact
end

#superclass_nameObject



83
84
85
# File 'lib/funfx/meta/parser.rb', line 83

def superclass_name
  @class_info['Extends']
end

#tabular?Boolean

Returns:

  • (Boolean)


99
100
101
# File 'lib/funfx/meta/parser.rb', line 99

def tabular?
  @class_info['SupportsTabularData'] == 'true'
end