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
lightningdb-happymapper-0.3.0 examples/post.rb
lightningdb-happymapper-0.3.1 examples/post.rb
lightningdb-happymapper-0.3.2 examples/post.rb
macasek-happymapper-0.2.5 examples/post.rb
macasek-happymapper-0.2.6 examples/post.rb
robmitch-happymapper-0.2.5 examples/post.rb
happymapper-0.4.1 examples/post.rb
happymapper-swanandp-0.4.0 examples/post.rb
happymapper-0.4.0 examples/post.rb
kdonovan-happymapper-0.3.7 examples/post.rb
happymapper-0.3.2 examples/post.rb
nokogiri-happymapper-0.3.4 examples/post.rb
happymapper-0.3.1 examples/post.rb
legolin-happymapper-0.3.0 examples/post.rb
nokogiri-happymapper-0.3.3 examples/post.rb
raus22-happymapper-0.3.3 examples/post.rb
happymapper-0.3.0 examples/post.rb
happymapper-0.2.1 examples/post.rb
happymapper-0.2.2 examples/post.rb
happymapper-0.1.4 examples/post.rb