Class: FakeChargify::Product
- Inherits:
-
Object
- Object
- FakeChargify::Product
- Defined in:
- lib/fake_chargify/product.rb
Instance Attribute Summary collapse
-
#accounting_code ⇒ Object
Returns the value of attribute accounting_code.
-
#family ⇒ Object
Returns the value of attribute family.
-
#handle ⇒ Object
Returns the value of attribute handle.
-
#interval ⇒ Object
Returns the value of attribute interval.
-
#name ⇒ Object
Returns the value of attribute name.
-
#price_in_cents ⇒ Object
Returns the value of attribute price_in_cents.
Instance Method Summary collapse
Instance Attribute Details
#accounting_code ⇒ Object
Returns the value of attribute accounting_code.
5 6 7 |
# File 'lib/fake_chargify/product.rb', line 5 def accounting_code @accounting_code end |
#family ⇒ Object
Returns the value of attribute family.
5 6 7 |
# File 'lib/fake_chargify/product.rb', line 5 def family @family end |
#handle ⇒ Object
Returns the value of attribute handle.
5 6 7 |
# File 'lib/fake_chargify/product.rb', line 5 def handle @handle end |
#interval ⇒ Object
Returns the value of attribute interval.
5 6 7 |
# File 'lib/fake_chargify/product.rb', line 5 def interval @interval end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/fake_chargify/product.rb', line 5 def name @name end |
#price_in_cents ⇒ Object
Returns the value of attribute price_in_cents.
5 6 7 |
# File 'lib/fake_chargify/product.rb', line 5 def price_in_cents @price_in_cents end |
Instance Method Details
#to_xml ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/fake_chargify/product.rb', line 7 def to_xml builder = Nokogiri::XML::Builder.new do |xml| xml.product { xml.accounting_code accounting_code xml.handle handle xml.interval interval xml.name name xml.price_in_cents price_in_cents xml << Nokogiri.XML(family.to_xml).root.to_xml unless family.nil? } end builder.to_xml end |