Class: AngularSprinkles::Directive::Controller

Inherits:
Object
  • Object
show all
Defined in:
lib/angular_sprinkles/directive/controller.rb

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Controller

Returns a new instance of Controller.



4
5
6
7
8
9
# File 'lib/angular_sprinkles/directive/controller.rb', line 4

def initialize(args)
  @name = args.fetch(:name)
  @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/directive/controller.rb', line 11

def bind(attribute = nil)
  @object_wrapper.new(@name, attribute, @bind_json_wrapper)
end

#call(function, *input) ⇒ Object



15
16
17
# File 'lib/angular_sprinkles/directive/controller.rb', line 15

def call(function, *input)
  @object_wrapper.new(@name, function, input, @call_json_wrapper)
end