sshaw / ddex

DDEX metadata serialization for Ruby
https://metadatagui.com
52 stars 41 forks source link

Update icpn.rb #3

Closed gcolson closed 9 years ago

gcolson commented 9 years ago

when using :ean? instead of :isean to write the IsEan attribute it doesn't seem to work.

sshaw commented 9 years ago

Hi, to write ean you assign to ean not ean?:

icpn = ICPN.new
icpn.ean = true
p icpn.ean?

This and other things are explained in the docs.

If that is what you are doing and it's not working can you please provide an example?

Also note that all the Ruby files are automatically generated.

sshaw commented 9 years ago

Just made my way to a console and confirmed this is working:

irb [1.9.3] (ddex)$ icpn = ICPN.new
=> #<DDEX::V20120404::DDEXC::ICPN:0x007fed0bb84d90>
irb [1.9.3] (ddex)$ icpn.ean = true
=> true
irb [1.9.3] (ddex)$ p icpn.ean?
true
=> true
irb [1.9.3] (ddex)$ icpn.to_xml.to_s
=> "<ICPN IsEan=\"true\"/>"
irb [1.9.3] (ddex)$ icpn.ean = false
=> false
irb [1.9.3] (ddex)$ icpn.to_xml.to_s
=> "<ICPN IsEan=\"false\"/>"

Feel free to reopen if this is not the case.

gcolson commented 9 years ago

Hi,

Thanks, it's working indeed !

Grégoire

Le 12/12/2014 22:46, Skye Shaw a écrit :

Just made my way to a console and confirmed this is working:

irb 1.9.3$ icpn = ICPN.new => #DDEX::V20120404::DDEXC::ICPN:0x007fed0bb84d90 irb 1.9.3$ icpn.ean = true => true irb 1.9.3$ p icpn.ean? true => true irb 1.9.3$ icpn.to_xml.to_s => "<ICPN IsEan=\"true\"/>" irb 1.9.3$ icpn.ean = false => false irb 1.9.3$ icpn.to_xml.to_s => "<ICPN IsEan=\"false\"/>"

Feel free to reopen if this is not the case.

— Reply to this email directly or view it on GitHub https://github.com/sshaw/ddex/pull/3#issuecomment-66840342.