Class: Rtlog::DayPage

Inherits:
Page
  • Object
show all
Defined in:
lib/rtlog/pages.rb

Instance Attribute Summary collapse

Attributes inherited from Page

#config, #log, #logger

Instance Method Summary collapse

Methods inherited from Page

#config_dir, #generate, #index_url, #month_pages, #parse, #size, #template_file_name, #template_path

Constructor Details

#initialize(config, log, day_entry) ⇒ DayPage

Returns a new instance of DayPage.



239
240
241
242
243
# File 'lib/rtlog/pages.rb', line 239

def initialize config, log, day_entry
  @config     = config
  @log        = log
  @day_entry  = day_entry
end

Instance Attribute Details

#day_entryObject (readonly)

Returns the value of attribute day_entry.



237
238
239
# File 'lib/rtlog/pages.rb', line 237

def day_entry
  @day_entry
end

Instance Method Details

#dateObject



249
250
251
# File 'lib/rtlog/pages.rb', line 249

def date
  @day_entry.date
end

#file_pathObject



259
260
261
# File 'lib/rtlog/pages.rb', line 259

def file_path
  File.expand_path( File.join(config['target_dir'], path, 'index.html') )
end

#titleObject



245
246
247
# File 'lib/rtlog/pages.rb', line 245

def title
  date.strftime('%Y-%m-%d')
end

#tweetsObject



253
254
255
256
257
# File 'lib/rtlog/pages.rb', line 253

def tweets
  @day_entry.tweets do |tw|
    yield tw
  end
end

#urlObject



263
264
265
# File 'lib/rtlog/pages.rb', line 263

def url
  config['url_prefix'] + '/' + path
end