Class: SPQR::ManageableMeta
- Inherits:
-
Struct
- Object
- Struct
- SPQR::ManageableMeta
- Defined in:
- lib/spqr/manageable.rb
Instance Attribute Summary collapse
-
#classname ⇒ Object
Returns the value of attribute classname.
-
#description ⇒ Object
Returns the value of attribute description.
-
#mmethods ⇒ Object
Returns the value of attribute mmethods.
-
#options ⇒ Object
Returns the value of attribute options.
-
#package ⇒ Object
Returns the value of attribute package.
-
#properties ⇒ Object
Returns the value of attribute properties.
-
#statistics ⇒ Object
Returns the value of attribute statistics.
Instance Method Summary collapse
- #declare_method(name, desc, options, blk = nil) ⇒ Object
- #declare_property(name, kind, options) ⇒ Object
- #declare_statistic(name, kind, options) ⇒ Object
-
#initialize(*a) ⇒ ManageableMeta
constructor
A new instance of ManageableMeta.
- #manageable_methods ⇒ Object
Constructor Details
#initialize(*a) ⇒ ManageableMeta
Returns a new instance of ManageableMeta.
27 28 29 30 31 32 33 |
# File 'lib/spqr/manageable.rb', line 27 def initialize(*a) super *a self. = (({} unless self.) or self..dup) self.statistics = [] unless self.statistics self.properties = [] unless self.properties self.mmethods ||= {} end |
Instance Attribute Details
#classname ⇒ Object
Returns the value of attribute classname
26 27 28 |
# File 'lib/spqr/manageable.rb', line 26 def classname @classname end |
#description ⇒ Object
Returns the value of attribute description
26 27 28 |
# File 'lib/spqr/manageable.rb', line 26 def description @description end |
#mmethods ⇒ Object
Returns the value of attribute mmethods
26 27 28 |
# File 'lib/spqr/manageable.rb', line 26 def mmethods @mmethods end |
#options ⇒ Object
Returns the value of attribute options
26 27 28 |
# File 'lib/spqr/manageable.rb', line 26 def @options end |
#package ⇒ Object
Returns the value of attribute package
26 27 28 |
# File 'lib/spqr/manageable.rb', line 26 def package @package end |
#properties ⇒ Object
Returns the value of attribute properties
26 27 28 |
# File 'lib/spqr/manageable.rb', line 26 def properties @properties end |
#statistics ⇒ Object
Returns the value of attribute statistics
26 27 28 |
# File 'lib/spqr/manageable.rb', line 26 def statistics @statistics end |
Instance Method Details
#declare_method(name, desc, options, blk = nil) ⇒ Object
35 36 37 38 39 |
# File 'lib/spqr/manageable.rb', line 35 def declare_method(name, desc, , blk=nil) result = MethodMeta.new name, desc, blk.call(result.args) if blk self.mmethods[name] = result end |
#declare_property(name, kind, options) ⇒ Object
49 50 51 |
# File 'lib/spqr/manageable.rb', line 49 def declare_property(name, kind, ) declare_basic(:property, name, kind, ) end |
#declare_statistic(name, kind, options) ⇒ Object
45 46 47 |
# File 'lib/spqr/manageable.rb', line 45 def declare_statistic(name, kind, ) declare_basic(:statistic, name, kind, ) end |
#manageable_methods ⇒ Object
41 42 43 |
# File 'lib/spqr/manageable.rb', line 41 def manageable_methods self.mmethods.values end |