Permalink
Browse files

Added the Cameraplus::PhotoExif class.

  • Loading branch information...
1 parent 2ade661 commit ca9487d56f2187ffa741b7aeb5ab4c40272648d5 @kevintuhumury kevintuhumury committed Mar 20, 2012
Showing with 37 additions and 0 deletions.
  1. +1 −0 lib/cameraplus.rb
  2. +13 −0 lib/cameraplus/photo_exif.rb
  3. +23 −0 spec/cameraplus/photo_exif_spec.rb
View
@@ -8,5 +8,6 @@
require "cameraplus/user"
require "cameraplus/page"
require "cameraplus/photo"
+require "cameraplus/photo_exif"
require "cameraplus/comment"
require "cameraplus/version"
@@ -0,0 +1,13 @@
+module Cameraplus
+ class PhotoExif
+
+ attr_reader :title, :value, :style
+
+ def initialize(data)
+ @title = data.title
+ @value = data.value
+ @style = data.style
+ end
+
+ end
+end
@@ -0,0 +1,23 @@
+require "spec_helper"
+
+describe Cameraplus::PhotoExif do
+
+ let(:data) do
+ { :title => "Exposure", :value => "1\/120 sec", :style => "main" }
+ end
+
+ subject { Cameraplus::PhotoExif.new data }
+
+ it "should have a title" do
+ subject.title.should eq "Exposure"
+ end
+
+ it "should have a value" do
+ subject.value.should eq "1/120 sec"
+ end
+
+ it "should have a style" do
+ subject.style.should eq "main"
+ end
+
+end

0 comments on commit ca9487d

Please sign in to comment.