Module: Stronger::PropertyDefinition::ClassMethods

Defined in:
lib/stronger/property_definition.rb

Instance Method Summary collapse

Instance Method Details

#propertiesObject



4
5
6
# File 'lib/stronger/property_definition.rb', line 4

def properties
  @properties ||= Array.new
end

#property(*names, **opts) ⇒ Object



12
13
14
15
16
# File 'lib/stronger/property_definition.rb', line 12

def property(*names, **opts)
  new_props = names.map {|name| Property.new(name, **opts) }
  properties.concat(new_props)
  new_props.each{|p| expose_property(p) unless opts.delete(:private)}
end

#property_namesObject



8
9
10
# File 'lib/stronger/property_definition.rb', line 8

def property_names
  properties.map(&:name)
end