This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: UTF-8 | |
class Checkout | |
@@current_items = {} | |
@@stock_items = {} | |
def initialize(pricing_rules) | |
# Sets the current_items hash to store the amount/type of items | |
set_items(pricing_rules) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spreadsheet' | |
book = Spreadsheet.open 'teams.xls' | |
sheet = book.worksheet 0 | |
sheet.each do |row| | |
team = Team.new | |
team.name = row[0].strip | |
team.code = row[1].strip | |
team.save |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BookingInformation | |
# attr_accessor :property,:children,:adults,:checkin,:checkout | |
def initialize(property,children,adults,checkin,checkout,lan) | |
@property = property | |
@children = children | |
@adults = adults | |
@checkin = checkin | |
@checkout = checkout | |
@lan = lan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% if @page.parent %> | |
<% if @page.parent.title == "Properties" %> | |
<h1>THISISPROPERTIES</h1> | |
<% end %> | |
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% (@page.children || @page.parent.children).each do |child| %> | |
<li><%= link_to(child.title,child.url) %> </li> | |
<% end %> | |
However @page.children returns an empty array instead of nil so this doesn't work. |
NewerOlder