Class: Syaso::ListItem

Inherits:
Base
  • Object
show all
Defined in:
lib/syaso/list_item.rb

Constant Summary

Constants inherited from Base

Base::BLOCK_BUFFER

Instance Attribute Summary

Attributes inherited from Base

#content

Instance Method Summary collapse

Methods inherited from Base

#render

Constructor Details

#initialize(context, holder, content) ⇒ ListItem

initialize instance

Parameters:

  • context (ActionView)
  • holder (Syaso::Base)
  • content (Object)


11
12
13
14
15
# File 'lib/syaso/list_item.rb', line 11

def initialize(context, holder, content)
  super(context)
  self.holder = holder
  self.content = content
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Syaso::Base

Instance Method Details

#indexInteger

index of this content in list's content.

Returns:

  • (Integer)


20
21
22
# File 'lib/syaso/list_item.rb', line 20

def index
  self.holder.index(self.content)
end