Class: Interface
- Inherits:
-
Object
- Object
- Interface
- Defined in:
- lib/shed/interface.rb
Overview
ActionScript 3 Interface Parser. Tokenises the contents of an interface into hashes.
All methods and properties are stored in Hashes. Details of methods can be obtained via :name String, :arguments Array, return: String. Properies have the keys :name String, :gets Boolean, :sets Boolean, and :type String.
Instance Attribute Summary collapse
-
#class_name ⇒ Object
readonly
Returns the value of attribute class_name.
-
#methods ⇒ Object
readonly
Returns the value of attribute methods.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#package ⇒ Object
readonly
Returns the value of attribute package.
-
#properties ⇒ Object
readonly
Returns the value of attribute properties.
Instance Method Summary collapse
-
#get_method(name) ⇒ Object
Returns the method hash associated with request name.
-
#get_property(name) ⇒ Object
Returns the proptert hash associated with request name.
-
#initialize(string) ⇒ Interface
constructor
A new instance of Interface.
Constructor Details
#initialize(string) ⇒ Interface
Returns a new instance of Interface.
18 19 20 21 22 23 24 25 26 |
# File 'lib/shed/interface.rb', line 18 def initialize(string) @doc = Stripper.ecma_comments(string) @properties, @methods = {}, {} @package, @name = '', '' raise "Document is not an interface" unless is_valid parse end |
Instance Attribute Details
#class_name ⇒ Object (readonly)
Returns the value of attribute class_name.
12 13 14 |
# File 'lib/shed/interface.rb', line 12 def class_name @class_name end |
#methods ⇒ Object (readonly)
Returns the value of attribute methods.
12 13 14 |
# File 'lib/shed/interface.rb', line 12 def methods @methods end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
12 13 14 |
# File 'lib/shed/interface.rb', line 12 def name @name end |
#package ⇒ Object (readonly)
Returns the value of attribute package.
12 13 14 |
# File 'lib/shed/interface.rb', line 12 def package @package end |
#properties ⇒ Object (readonly)
Returns the value of attribute properties.
12 13 14 |
# File 'lib/shed/interface.rb', line 12 def properties @properties end |
Instance Method Details
#get_method(name) ⇒ Object
Returns the method hash associated with request name.
31 32 33 |
# File 'lib/shed/interface.rb', line 31 def get_method(name) @methods[name] end |
#get_property(name) ⇒ Object
Returns the proptert hash associated with request name.
38 39 40 |
# File 'lib/shed/interface.rb', line 38 def get_property(name) @properties[name] end |