Class: Sinatra::Ember::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/sinatra/ember.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app, &block) ⇒ Options

Returns a new instance of Options.



84
85
86
87
88
89
90
# File 'lib/sinatra/ember.rb', line 84

def initialize(app, &block)
  @app = app
  @template_name_style = :path
  @template_packages = {}

  instance_eval(&block)
end

Instance Attribute Details

#template_packagesObject (readonly)

Returns the value of attribute template_packages.



82
83
84
# File 'lib/sinatra/ember.rb', line 82

def template_packages
  @template_packages
end

Instance Method Details

#template_name_style(*args) ⇒ Object Also known as: template_name_style=



100
101
102
103
104
105
106
# File 'lib/sinatra/ember.rb', line 100

def template_name_style(*args)
  val = args.first
  if not val.nil?
    @template_name_style = val
  end
  return @template_name_style
end

#templates(route, files = [], opts = {}) ⇒ Object



92
93
94
95
96
97
98
# File 'lib/sinatra/ember.rb', line 92

def templates(route, files=[], opts={})
  opts_defaults = {
    :relative_to => '',
  }
  opts = opts_defaults.merge(opts)
  @template_packages[route] = TemplateSpec.new(route, files, opts)
end