Class: BinderCore::Binder

Inherits:
Object
  • Object
show all
Defined in:
lib/binder_core/binder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, user_config = nil) ⇒ Binder

Returns a new instance of Binder.



6
7
8
9
10
11
# File 'lib/binder_core/binder.rb', line 6

def initialize(name, user_config = nil)
  @name = name.is_a?(Symbol) ? name : name.to_s
  @config = lambda do |config|
    user_config.call(config) if user_config
  end  
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



3
4
5
# File 'lib/binder_core/binder.rb', line 3

def config
  @config
end

#consoleObject (readonly)

Returns the value of attribute console.



3
4
5
# File 'lib/binder_core/binder.rb', line 3

def console
  @console
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/binder_core/binder.rb', line 3

def name
  @name
end

#rawObject

Returns the value of attribute raw.



4
5
6
# File 'lib/binder_core/binder.rb', line 4

def raw
  @raw
end

Instance Method Details

#init_console(console) ⇒ Object

:NODOC:



22
23
24
# File 'lib/binder_core/binder.rb', line 22

def init_console(console)
  @console = console
end


13
14
15
16
17
18
19
# File 'lib/binder_core/binder.rb', line 13

def link_assets
  data    = @raw[:data]||{}
  assets  = @raw[:assets] || []
  data    = Compiler.link_assets(data)
  
  {:data => data, :assets => assets.dup }
end