Skip to content
Browse files

Add type to rooms

  • Loading branch information...
1 parent 74d0db5 commit 2d24e83f7ce51d78f3f00ef0967d0729b1ecee54 Mike Fulcher committed Mar 27, 2012
Showing with 11 additions and 1 deletion.
  1. +4 −0 lib/vebra/parse.rb
  2. +1 −1 lib/vebra/version.rb
  3. +6 −0 spec/support/expected_output.rb
View
4 lib/vebra/parse.rb
@@ -273,6 +273,10 @@ def customise(hash)
%w( rooms energy_reports disclaimers ).map(&:to_sym).each do |paragraph_type|
hash[paragraph_type].each { |p| p[:vebra_ref] = p.delete(:id); p.delete(:type) }
end
+
+ hash[:rooms].each do |room|
+ room[:type] = room[:name].gsub(/\s?[\d+]$/, '').downcase.gsub(/\s/, '_')
+ end
end
# was: { :files => [ #<file - type a>, #<file - type b> ] }
View
2 lib/vebra/version.rb
@@ -1,3 +1,3 @@
module Vebra
- VERSION = "0.0.4"
+ VERSION = "0.0.5"
end
View
6 spec/support/expected_output.rb
@@ -97,6 +97,7 @@
{
:vebra_ref => 1,
:name => "Bedroom 1",
+ :type => "bedroom",
:file => nil,
:dimensions => {
:metric => nil,
@@ -107,6 +108,7 @@
{
:vebra_ref => 2,
:name => "Bedroom 2",
+ :type => "bedroom",
:file => nil,
:dimensions => {
:metric => nil,
@@ -117,6 +119,7 @@
{
:vebra_ref => 3,
:name => "Bedroom 3",
+ :type => "bedroom",
:file => nil,
:dimensions => {
:metric => nil,
@@ -127,6 +130,7 @@
{
:vebra_ref => 4,
:name => "Bedroom 4",
+ :type => "bedroom",
:file => nil,
:dimensions => {
:metric => nil,
@@ -137,6 +141,7 @@
{
:vebra_ref => 5,
:name => "Reception 1",
+ :type => "reception",
:file => nil,
:dimensions => {
:metric => nil,
@@ -147,6 +152,7 @@
{
:vebra_ref => 6,
:name => "Reception 2",
+ :type => "reception",
:file => nil,
:dimensions => {
:metric => nil,

0 comments on commit 2d24e83

Please sign in to comment.
Something went wrong with that request. Please try again.