class ResumeTools::Section

Section

Represents a section in the resume

Attributes

items[R]

List of items

para[RW]

Section paragraph

periods[R]

List of periods

title[RW]

Section title

Public Class Methods

new(props={}) click to toggle source
# File lib/resumetools/resume/resume.rb, line 148
def initialize(props={})
  @title = props[:title] || ""
  @para = props[:para] || ""
  @items = Array.new
  @periods = Array.new
end

Public Instance Methods

add_item(item) click to toggle source

Ads an item

# File lib/resumetools/resume/resume.rb, line 194
def add_item(item)
  self.items << item
end
add_period(period) click to toggle source

Adds a period

# File lib/resumetools/resume/resume.rb, line 189
def add_period(period)
  self.periods << period
end
create_item(props={}, &block) click to toggle source

Creates an item and adds it to the list

# File lib/resumetools/resume/resume.rb, line 199
def create_item(props={}, &block)
  item = Item.new(props)
  block.call(item) if block
  self.add_item(item)
  self
end
create_period(props={}, &block) click to toggle source

Creates a period and adds it to the list

# File lib/resumetools/resume/resume.rb, line 181
def create_period(props={}, &block)
  period = Period.new(props)
  block.call(period) if block
  self.add_period(period)
  self
end
has_items?() click to toggle source
# File lib/resumetools/resume/resume.rb, line 165
def has_items?
  !self.items.empty?
end
has_para?() click to toggle source
# File lib/resumetools/resume/resume.rb, line 160
def has_para?
  self.has_paragraph?
end
has_paragraph?() click to toggle source
# File lib/resumetools/resume/resume.rb, line 156
def has_paragraph?
  !self.para.blank?
end
has_periods?() click to toggle source
# File lib/resumetools/resume/resume.rb, line 170
def has_periods?
  !self.periods.empty?
end
has_title?() click to toggle source
# File lib/resumetools/resume/resume.rb, line 175
def has_title?
  !self.title.blank?

end