class AcmsRuby::Column

Constants

ACMS_UNIT_TEXT_DELIMITER

Public Instance Methods

html() click to toggle source
# File lib/acms_ruby/models/column.rb, line 26
def html
  case type
  when 'text'
    "<#{field_2}>#{text}</#{field_2}>"
  when 'image'
    "<img src=\"#{field_2}\" />"
  else
    nil
  end
end
text(sel=nil) click to toggle source
# File lib/acms_ruby/models/column.rb, line 15
def text(sel=nil)
  return nil if type != 'text'
  sel ||= 0
  texts[sel]
end
texts() click to toggle source
# File lib/acms_ruby/models/column.rb, line 21
def texts
  return nil if type != 'text'
  field_1.split(ACMS_UNIT_TEXT_DELIMITER)
end