Class: PropertyGrid::PropertyGridGroup

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializePropertyGridGroup

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

#nameObject

Returns the value of attribute name.



35
36
37
# File 'lib/property_grid.rb', line 35

def name
  @name
end

#propertiesObject

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