Module: BigBand::Generated
- Included in:
- BigBand
- Defined in:
- lib/big_band.rb
Overview
Classes generated by BigBand.generate_class will be extended with this class.
Instance Attribute Summary collapse
-
#big_band_constructor ⇒ Object
readonly
Returns the value of attribute big_band_constructor.
-
#big_band_extensions ⇒ Object
readonly
Returns the value of attribute big_band_extensions.
Instance Method Summary collapse
-
#inherited(klass) ⇒ Object
Adds extensions to subclass.
-
#inspect ⇒ Object
Use Generated#name for inspection.
-
#name ⇒ Object
Nice output for inspect and friends: foo = Class.new BigBand(:SomeExtension) foo.name # => BigBand(:SomeExtension) Foo = foo foo.name # => Foo.
Instance Attribute Details
#big_band_constructor ⇒ Object (readonly)
Returns the value of attribute big_band_constructor.
90 91 92 |
# File 'lib/big_band.rb', line 90 def big_band_constructor @big_band_constructor end |
#big_band_extensions ⇒ Object (readonly)
Returns the value of attribute big_band_extensions.
90 91 92 |
# File 'lib/big_band.rb', line 90 def big_band_extensions @big_band_extensions end |
Instance Method Details
#inherited(klass) ⇒ Object
Adds extensions to subclass
93 94 95 96 97 |
# File 'lib/big_band.rb', line 93 def inherited(klass) super BigBand.applications << klass BigBand.load_extensions(klass, *big_band_extensions) end |
#inspect ⇒ Object
Use Generated#name for inspection.
100 101 102 |
# File 'lib/big_band.rb', line 100 def inspect name end |
#name ⇒ Object
Nice output for inspect and friends:
foo = Class.new BigBand(:SomeExtension)
foo.name # => BigBand(:SomeExtension)
Foo = foo
foo.name # => Foo
109 110 111 112 |
# File 'lib/big_band.rb', line 109 def name real_name = super real_name.empty? ? big_band_constructor : real_name end |