Class: ActionScriptClass

Inherits:
Object
  • Object
show all
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

JustImplement, Mock4AS

Instance Method Summary collapse

Instance Method Details

#footObject

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