Class: ReVIEW::Book::FormatRef
Instance Method Summary
collapse
Constructor Details
#initialize(locale, index) ⇒ FormatRef
Returns a new instance of FormatRef.
246
247
248
249
|
# File 'lib/review/book/index.rb', line 246
def initialize(locale, index)
@locale = locale
@index = index
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(mid, *args, &block) ⇒ Object
261
262
263
264
|
# File 'lib/review/book/index.rb', line 261
def method_missing(mid, *args, &block)
super unless @index.respond_to?(mid)
@index.__send__(mid, *args, &block)
end
|
Instance Method Details
#number(id) ⇒ Object
256
257
258
259
|
# File 'lib/review/book/index.rb', line 256
def number(id)
sprintf(@locale["#{@index.item_type}_number_format".to_sym],
@index.number(id))
end
|
#title(id) ⇒ Object
251
252
253
254
|
# File 'lib/review/book/index.rb', line 251
def title(id)
sprintf(@locale["#{@index.item_type}_caption_format".to_sym],
@index.title(id))
end
|