Class: RTunesU::HasAEntityCollectionProxy

Inherits:
SubentityAssociationProxy show all
Defined in:
lib/rtunesu/subentities.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from SubentityAssociationProxy

#initialize

Constructor Details

This class inherits a constructor from RTunesU::SubentityAssociationProxy

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args) ⇒ Object



29
30
31
# File 'lib/rtunesu/subentities.rb', line 29

def method_missing(method_name, *args)
  @target.send(method_name, args)
end

Instance Attribute Details

#targetObject (readonly)

Returns the value of attribute target.



16
17
18
# File 'lib/rtunesu/subentities.rb', line 16

def target
  @target
end

Instance Method Details

#from_xml(name) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/rtunesu/subentities.rb', line 17

def from_xml(name)
  if @source_xml
   @target = "RTunesU::#{name}".constantize.new(:source_xml => @source_xml.first, :parent_handle => @owner.handle)
  else
   @target = "RTunesU::#{name}".constantize.new(:parent_handle => @owner.handle)
  end
end

#to_xml(builder) ⇒ Object



25
26
27
# File 'lib/rtunesu/subentities.rb', line 25

def to_xml(builder)
  @target.to_xml(builder) if @target.edits.any?
end