--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: "Adds reader and writer methods for manipulating a value object: <tt>composed_of :address</tt> adds <tt>address</tt> and <tt>address=(new_address)</tt> methods."
- !ruby/struct:SM::Flow::P 
  body: "Options are:"
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>:class_name</tt> - specify the class name of the association. Use it only if that name can't be inferred from the part id. So <tt>composed_of :address</tt> will by default be linked to the Address class, but if the real class name is CompanyAddress, you'll have to specify it with this option.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>:mapping</tt> - specifies a number of mapping arrays (attribute, parameter) that bind an attribute name to a constructor parameter on the value class.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>:allow_nil</tt> - specifies that the aggregate object will not be instantiated when all mapped attributes are <tt>nil</tt>. Setting the aggregate class to <tt>nil</tt> has the effect of writing <tt>nil</tt> to all mapped attributes. This defaults to <tt>false</tt>.
  type: :BULLET
- !ruby/struct:SM::Flow::P 
  body: An optional block can be passed to convert the argument that is passed to the writer method into an instance of <tt>:class_name</tt>. The block will only be called if the argument is not already an instance of <tt>:class_name</tt>.
- !ruby/struct:SM::Flow::P 
  body: "Option examples:"
- !ruby/struct:SM::Flow::VERB 
  body: "  composed_of :temperature, :mapping =&gt; %w(reading celsius)\n  composed_of(:balance, :class_name =&gt; &quot;Money&quot;, :mapping =&gt; %w(balance amount)) {|balance| balance.to_money }\n  composed_of :address, :mapping =&gt; [ %w(address_street street), %w(address_city city) ]\n  composed_of :gps_location\n  composed_of :gps_location, :allow_nil =&gt; true\n"
full_name: ActiveRecord::Aggregations::ClassMethods#composed_of
is_singleton: false
name: composed_of
params: (part_id, options = {}, &block)
visibility: public
