Class: PropertyGrid::APropertyGrid
- Inherits:
-
Object
- Object
- PropertyGrid::APropertyGrid
- Defined in:
- lib/property_grid.rb
Overview
Class defining the property grid A property grid consists of property groups, and groups contain properties.
Instance Attribute Summary collapse
-
#groups ⇒ Object
Returns the value of attribute groups.
Instance Method Summary collapse
-
#add_group(name) {|group| ... } ⇒ Object
Give a group name, creates a group, yielding to a block that can be used to define properties within the group, and returning self so that additional groups can be added in a fluid code style.
-
#initialize ⇒ APropertyGrid
constructor
A new instance of APropertyGrid.
Constructor Details
#initialize ⇒ APropertyGrid
Returns a new instance of APropertyGrid.
95 96 97 |
# File 'lib/property_grid.rb', line 95 def initialize @groups = [] end |
Instance Attribute Details
#groups ⇒ Object
Returns the value of attribute groups.
93 94 95 |
# File 'lib/property_grid.rb', line 93 def groups @groups end |
Instance Method Details
#add_group(name) {|group| ... } ⇒ Object
Give a group name, creates a group, yielding to a block that can be used to define properties within the group, and returning self so that additional groups can be added in a fluid code style.
102 103 104 105 106 107 108 |
# File 'lib/property_grid.rb', line 102 def add_group(name) group = PropertyGridGroup.new group.name = name @groups << group yield(group) # yields to block creating group properties self # returns the PropertyGrid instance end |