Class: BinderCore::Binder
- Inherits:
-
Object
- Object
- BinderCore::Binder
- Defined in:
- lib/binder_core/binder.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#console ⇒ Object
readonly
Returns the value of attribute console.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#raw ⇒ Object
Returns the value of attribute raw.
Instance Method Summary collapse
-
#init_console(console) ⇒ Object
:NODOC:.
-
#initialize(name, user_config = nil) ⇒ Binder
constructor
A new instance of Binder.
- #link_assets ⇒ Object
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
#config ⇒ Object (readonly)
Returns the value of attribute config.
3 4 5 |
# File 'lib/binder_core/binder.rb', line 3 def config @config end |
#console ⇒ Object (readonly)
Returns the value of attribute console.
3 4 5 |
# File 'lib/binder_core/binder.rb', line 3 def console @console end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/binder_core/binder.rb', line 3 def name @name end |
#raw ⇒ Object
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 |
#link_assets ⇒ Object
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 |