module CIMI::Helper

Public Instance Methods

href_id(href, entity) click to toggle source
# File lib/cimi/helpers/cimi_helper.rb, line 24
def href_id(href, entity)
  split_on = self.send(:"#{entity.to_s}_url")
  href.split("#{split_on}/").last
end
no_content_with_status(code=200) click to toggle source
# File lib/cimi/helpers/cimi_helper.rb, line 19
def no_content_with_status(code=200)
  body ''
  status code
end
to_kibibyte(value, unit) click to toggle source
# File lib/cimi/helpers/cimi_helper.rb, line 29
def to_kibibyte(value, unit)
  case unit
  when "GB"
    value*1024*1024
  when "MB"
    value*1024
  else
    nil # should probably be exploding something here...
  end
end