Class: FunFX::Meta::FlexMetaClass
- Defined in:
- lib/funfx/meta/parser.rb
Instance Attribute Summary
Attributes inherited from MetaClass
Instance Method Summary collapse
- #dot_event_list ⇒ Object
- #dot_property_list ⇒ Object
- #events ⇒ Object
-
#initialize(class_info) ⇒ FlexMetaClass
constructor
A new instance of FlexMetaClass.
- #link_with(lib) ⇒ Object
- #lookup_method ⇒ Object
- #name ⇒ Object
- #properties ⇒ Object
- #superclass_name ⇒ Object
- #tabular? ⇒ Boolean
Methods inherited from MetaClass
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_list ⇒ Object
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_list ⇒ Object
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 |
#events ⇒ Object
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 |
#link_with(lib) ⇒ Object
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_method ⇒ Object
113 114 115 |
# File 'lib/funfx/meta/parser.rb', line 113 def lookup_method name.underscore.gsub(/^flex_/, '') end |
#name ⇒ Object
79 80 81 |
# File 'lib/funfx/meta/parser.rb', line 79 def name @class_info['Name'] end |
#properties ⇒ Object
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_name ⇒ Object
83 84 85 |
# File 'lib/funfx/meta/parser.rb', line 83 def superclass_name @class_info['Extends'] end |
#tabular? ⇒ Boolean
99 100 101 |
# File 'lib/funfx/meta/parser.rb', line 99 def tabular? @class_info['SupportsTabularData'] == 'true' end |