rabl 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  module JRB
2
2
  class Builder
3
- # Constructs a new ejs generator based on given object and options
3
+ # Constructs a new ejs hash based on given object and options
4
4
  def initialize(object, options, &block)
5
5
  @_object = object
6
6
  @_result = {}
@@ -94,7 +94,7 @@ module JRB
94
94
  # Returns a hash based representation of any data object given ejs template block
95
95
  # object_to_hash(@user) { attribute :full_name } => { ... }
96
96
  def object_to_hash(object, source=nil, &block)
97
- @options[:generator].object_to_hash(object, source, &block)
97
+ @options[:engine].object_to_hash(object, source, &block)
98
98
  end
99
99
 
100
100
  # data_object(data) => <AR Object>
@@ -1,10 +1,10 @@
1
1
  module JRB
2
2
  class Engine
3
- # Constructs a new ejs generator based on given vars, handler and declarations
3
+ # Constructs a new ejs engine based on given vars, handler and declarations
4
4
  def initialize(vars, handler, source_string=nil, &block)
5
5
  @_vars = vars
6
6
  @_handler = handler
7
- @_options = { :handler => @_handler, :vars => @_vars, :generator => self }
7
+ @_options = { :handler => @_handler, :vars => @_vars, :engine => self }
8
8
  self.copy_instance_variables_from(@_handler, [:@assigns, :@helpers]);
9
9
  @_object = vars[:object] || instance_variable_get("@#{@_handler.controller.controller_name}")
10
10
  instance_eval(source_string) if source_string.present?
@@ -7,7 +7,7 @@ module ActionView
7
7
  include Compilable
8
8
 
9
9
  def compile(template) %{
10
- ::JRB::Generator.new(assigns.merge(local_assigns), self) do
10
+ ::JRB::Engine.new(assigns.merge(local_assigns), self) do
11
11
  #{template.source}
12
12
  end.to_#{template.format}
13
13
  } end
@@ -1,3 +1,3 @@
1
1
  module Rabl
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rabl
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Nathan Esquenazi