Sha256: 0be04547e7676db9ac53b082eddabbfe1a6d4233ffe928c91a71be26f6644a62

Contents?: true

Size: 519 Bytes

Versions: 50

Compression:

Stored size: 519 Bytes

Contents

dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
require File.join(dir, 'happymapper')

file_contents = File.read(dir + '/../spec/fixtures/posts.xml')

class Post
  include HappyMapper
  
  attribute :href, String
  attribute :hash, String
  attribute :description, String
  attribute :tag, String
  attribute :time, DateTime
  attribute :others, Integer
  attribute :extended, String
end

posts = Post.parse(file_contents)
posts.each { |post| puts post.description, post.href, post.extended, '' }

Version data entries

50 entries across 50 versions & 13 rubygems

Version Path
happymapper-0.5.0 examples/post.rb
dam5s-happymapper-0.3.2 examples/post.rb
gotascii-happymapper-0.1.6 examples/post.rb
jimmyz-happymapper-0.3.1 examples/post.rb
jimmyz-happymapper-0.3.2 examples/post.rb
jimmyz-happymapper-0.3.3 examples/post.rb
jnunemaker-happymapper-0.1.2 examples/post.rb
jnunemaker-happymapper-0.1.3 examples/post.rb
jnunemaker-happymapper-0.1.4 examples/post.rb
jnunemaker-happymapper-0.1.5 examples/post.rb
jnunemaker-happymapper-0.1.6 examples/post.rb
jnunemaker-happymapper-0.1.7 examples/post.rb
jnunemaker-happymapper-0.2.0 examples/post.rb
jnunemaker-happymapper-0.2.1 examples/post.rb
jnunemaker-happymapper-0.2.2 examples/post.rb
jnunemaker-happymapper-0.2.3 examples/post.rb
jnunemaker-happymapper-0.2.4 examples/post.rb
jnunemaker-happymapper-0.2.5 examples/post.rb
kdonovan-happymapper-0.3.4 examples/post.rb
kdonovan-happymapper-0.3.5 examples/post.rb