Class: PropertyGrid::PropertyGridGroup
- Inherits:
-
Object
- Object
- PropertyGrid::PropertyGridGroup
- Defined in:
- lib/property_grid.rb
Overview
Defines a PropertyGrid group A group has a name and a collection of properties.
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#properties ⇒ Object
Returns the value of attribute properties.
Instance Method Summary collapse
-
#add_property(var, name, property_type = :string, collection = nil) ⇒ Object
Adds a property to the properties collection and returns self.
-
#initialize ⇒ PropertyGridGroup
constructor
A new instance of PropertyGridGroup.
Constructor Details
#initialize ⇒ PropertyGridGroup
Returns a new instance of PropertyGridGroup.
38 39 40 41 |
# File 'lib/property_grid.rb', line 38 def initialize @name = nil @properties = [] end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
35 36 37 |
# File 'lib/property_grid.rb', line 35 def name @name end |
#properties ⇒ Object
Returns the value of attribute properties.
36 37 38 |
# File 'lib/property_grid.rb', line 36 def properties @properties end |
Instance Method Details
#add_property(var, name, property_type = :string, collection = nil) ⇒ Object
Adds a property to the properties collection and returns self.
44 45 46 47 48 |
# File 'lib/property_grid.rb', line 44 def add_property(var, name, property_type = :string, collection = nil) group_property = GroupProperty.new(var, name, property_type, collection) @properties << group_property self end |