Class: RailsBootstrapEngine::BootstrapMarkupCollection

Inherits:
Object
  • Object
show all
Defined in:
lib/rails-bootstrap-engine/markup/bootstrap_markup_collection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(view) ⇒ BootstrapMarkupCollection

Returns a new instance of BootstrapMarkupCollection.



19
20
21
22
# File 'lib/rails-bootstrap-engine/markup/bootstrap_markup_collection.rb', line 19

def initialize(view)
  @view = view
  @calls = []
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(symbol, *args, &block) ⇒ Object



24
25
26
# File 'lib/rails-bootstrap-engine/markup/bootstrap_markup_collection.rb', line 24

def method_missing(symbol, *args, &block)
  @calls << HelperMethodCall.new(@view, symbol, args, block)
end

Instance Attribute Details

#callsObject

Returns the value of attribute calls.



17
18
19
# File 'lib/rails-bootstrap-engine/markup/bootstrap_markup_collection.rb', line 17

def calls
  @calls
end

#viewObject

Returns the value of attribute view.



17
18
19
# File 'lib/rails-bootstrap-engine/markup/bootstrap_markup_collection.rb', line 17

def view
  @view
end

Instance Method Details

#[](x) ⇒ Object



34
35
36
# File 'lib/rails-bootstrap-engine/markup/bootstrap_markup_collection.rb', line 34

def [](x)
  @calls[x]
end

#eachObject



28
29
30
31
32
# File 'lib/rails-bootstrap-engine/markup/bootstrap_markup_collection.rb', line 28

def each
  @calls.each do |c|
    yield c
  end
end

#shiftObject



42
43
44
# File 'lib/rails-bootstrap-engine/markup/bootstrap_markup_collection.rb', line 42

def shift
  @calls.shift
end

#sizeObject



38
39
40
# File 'lib/rails-bootstrap-engine/markup/bootstrap_markup_collection.rb', line 38

def size
  @calls.size
end