Class: AngularSprinkles::Element::Scope
- Inherits:
-
Object
- Object
- AngularSprinkles::Element::Scope
- Defined in:
- lib/angular_sprinkles/element/scope.rb
Instance Method Summary collapse
- #bind(attribute = nil) ⇒ Object
- #call(function, *input) ⇒ Object
-
#initialize(args) ⇒ Scope
constructor
A new instance of Scope.
Constructor Details
#initialize(args) ⇒ Scope
Returns a new instance of Scope.
4 5 6 7 8 9 |
# File 'lib/angular_sprinkles/element/scope.rb', line 4 def initialize(args) @base = args.fetch(:base) @object_wrapper = args.fetch(:object_wrapper) @bind_json_wrapper = args.fetch(:bind_json_wrapper) @call_json_wrapper = args.fetch(:call_json_wrapper) end |
Instance Method Details
#bind(attribute = nil) ⇒ Object
11 12 13 |
# File 'lib/angular_sprinkles/element/scope.rb', line 11 def bind(attribute = nil) @object_wrapper.new(@base, attribute, @bind_json_wrapper) end |
#call(function, *input) ⇒ Object
15 16 17 |
# File 'lib/angular_sprinkles/element/scope.rb', line 15 def call(function, *input) @object_wrapper.new(@base, function, input, @call_json_wrapper) end |