Class: ActionScriptClass
- Inherits:
-
Object
- Object
- ActionScriptClass
- Defined in:
- lib/shed/mixers/actionscript_class.rb
Overview
Takes an ActionScript 3 Interface file and generates a ActionScript class from it.
Direct Known Subclasses
Instance Method Summary collapse
-
#foot ⇒ Object
Returns a string formatted as the footer of a ActionScript document.
-
#get(name, type) ⇒ Object
Returns a string formatted as a public ActionScript getter.
-
#head(name, interface) ⇒ Object
Returns a string formatted as the head of a ActionScript document.
-
#method(name, arguments, returns) ⇒ Object
Returns a string formatted as a public ActionScript method.
-
#set(name, type) ⇒ Object
Returns a string formatted as a public ActionScript setter.
Instance Method Details
#foot ⇒ Object
Returns a string formatted as the footer of a ActionScript document.
40 41 42 |
# File 'lib/shed/mixers/actionscript_class.rb', line 40 def foot "\n}\n}\n" end |
#get(name, type) ⇒ Object
Returns a string formatted as a public ActionScript getter.
19 20 21 |
# File 'lib/shed/mixers/actionscript_class.rb', line 19 def get(name,type) template(name, '', type,'get ') end |
#head(name, interface) ⇒ Object
Returns a string formatted as the head of a ActionScript document.
12 13 14 |
# File 'lib/shed/mixers/actionscript_class.rb', line 12 def head(name,interface) "package\n{\n\nclass #{name} implements #{interface}\n{\n\n" end |
#method(name, arguments, returns) ⇒ Object
Returns a string formatted as a public ActionScript method.
33 34 35 |
# File 'lib/shed/mixers/actionscript_class.rb', line 33 def method(name,arguments,returns) template(name,arguments,returns) end |
#set(name, type) ⇒ Object
Returns a string formatted as a public ActionScript setter.
26 27 28 |
# File 'lib/shed/mixers/actionscript_class.rb', line 26 def set(name,type) template(name, "value:#{type}", 'void','set ') end |