Class | Rabl::Builder |
In: |
lib/rabl/builder.rb
|
Parent: | Object |
Constructs a new rabl hash based on given object and options options = { :format => "json", :root => true, :child_root => true,
:attributes, :node, :child, :glue, :extends }
Given an object and options, returns the hash representation build(@user, :format => "json", :attributes => { … }, :root_name => "user")
Returns a hash representation of the data object compile_hash(:root_name => false) compile_hash(:root_name => "user")
Extends an existing rabl template with additional attributes in the block extends("users/show") { attribute :full_name }
resolve_condition(:if => true) => true resolve_condition(:if => lambda { |m| false }) => false resolve_condition(:unless => lambda { |m| true }) => true