Class: ReVIEW::Book::ImageIndex::Item

Inherits:
Object
  • Object
show all
Defined in:
lib/review/book/index.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, number, caption = nil) ⇒ Item

Returns a new instance of Item.



165
166
167
168
169
170
# File 'lib/review/book/index.rb', line 165

def initialize(id, number, caption = nil)
  @id = id
  @number = number
  @caption = caption
  @path = nil
end

Instance Attribute Details

#captionObject (readonly)

Returns the value of attribute caption.



174
175
176
# File 'lib/review/book/index.rb', line 174

def caption
  @caption
end

#idObject (readonly)

Returns the value of attribute id.



172
173
174
# File 'lib/review/book/index.rb', line 172

def id
  @id
end

#index=(value) ⇒ Object (writeonly)

internal use only



175
176
177
# File 'lib/review/book/index.rb', line 175

def index=(value)
  @index = value
end

#numberObject (readonly)

Returns the value of attribute number.



173
174
175
# File 'lib/review/book/index.rb', line 173

def number
  @number
end

Instance Method Details

#bound?Boolean

Returns:

  • (Boolean)


177
178
179
# File 'lib/review/book/index.rb', line 177

def bound?
  path
end

#pathObject



181
182
183
# File 'lib/review/book/index.rb', line 181

def path
  @path ||= @index.find_path(id)
end