Skip to content
This repository has been archived by the owner on Jan 18, 2022. It is now read-only.

Commit

Permalink
configure the Nibbler base parser class
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Feb 26, 2013
1 parent be2e638 commit d7ffa8e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions lib/ahora/representation.rb
Expand Up @@ -54,6 +54,12 @@ def boolean(*names)
end

private

# allows using block sub-parsers without explicitly stating they need to
# inherit from Ahora::Representation
def base_parser_class
Representation
end
end

extend Definition
Expand Down
4 changes: 2 additions & 2 deletions test/ahora_test.rb
Expand Up @@ -47,11 +47,11 @@ class Post < Ahora::Representation
element './parentObjectId' => :parent_id, :with => lambda {|n| n.content.to_i }
date :created_at
element :body
element 'user', :with => Ahora::Representation do
element 'user' do
string :first_name, :last_name
end
boolean :hidden
elements 'replies/userPost' => :replies, :with => Post
elements 'replies/userPost' => :replies, :with => self
end

class PostDomainRepository < PostRepository
Expand Down

0 comments on commit d7ffa8e

Please sign in to comment.