rabl 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,6 +16,10 @@ module Rabl
16
16
  # Returns a hash representation of the data object
17
17
  # to_hash(:root => true)
18
18
  def to_hash(options={})
19
+ # Extends
20
+ @options[:extends].each do |settings|
21
+ extends(settings[:file], settings[:options], &settings[:block])
22
+ end if @options.has_key?(:extends)
19
23
  # Attributes
20
24
  @options[:attributes].each_pair do |attribute, name|
21
25
  attribute(attribute, :as => name)
@@ -32,10 +36,6 @@ module Rabl
32
36
  @options[:glue].each do |settings|
33
37
  glue(settings[:data], &settings[:block])
34
38
  end if @options.has_key?(:glue)
35
- # Extends
36
- @options[:extends].each do |settings|
37
- extends(settings[:file], settings[:options], &settings[:block])
38
- end if @options.has_key?(:extends)
39
39
  # Return Hash
40
40
  @_root_name ||= data_name(@_data)
41
41
  (@options[:root] || options[:root]) && @_root_name ? { @_root_name => @_result } : @_result
@@ -1,3 +1,3 @@
1
1
  module Rabl
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: rabl
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.5
5
+ version: 0.1.6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Nathan Esquenazi
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-04-27 00:00:00 -07:00
13
+ date: 2011-05-04 00:00:00 -07:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -113,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
113
  requirements: []
114
114
 
115
115
  rubyforge_project: rabl
116
- rubygems_version: 1.5.2
116
+ rubygems_version: 1.6.2
117
117
  signing_key:
118
118
  specification_version: 3
119
119
  summary: General ruby templating for json or xml