Skip to content

Commit

Permalink
added Float data property support
Browse files Browse the repository at this point in the history
  • Loading branch information
naoyamakino committed Nov 25, 2012
1 parent ccf6c98 commit b39636d
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ resources/*.nib
resources/*.momd
resources/*.storyboardc
examples/**/*.nib
tags
1 change: 1 addition & 0 deletions app/test_models.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class Author
hasMany :articles, :destinationEntity => Article.entityDescription, :inverse => :author

property :name, String, :required => true
property :fee, Float
end

class Article
Expand Down
3 changes: 3 additions & 0 deletions lib/motion_data/managed_object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ class Integer16

class Transformable
end

class Float
end
end

class ManagedObject < MotionDataManagedObjectBase
Expand Down
2 changes: 2 additions & 0 deletions lib/motion_data/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ def self.withReflection(reflection)
NSTransformableAttributeType
elsif type == CoreTypes::Integer16
NSInteger16AttributeType
elsif type == CoreTypes::Float
NSFloatAttributeType
else
# Transient types?
NSUndefinedAttributeType
Expand Down
2 changes: 1 addition & 1 deletion lib/motion_data/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module MotionData
VERSION = "0.0.3"
VERSION = "0.0.4"
end
6 changes: 6 additions & 0 deletions spec/managed_object_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ module MotionData
author.name.should == "Edgar Allan Poe"
end

it "includes Float support" do
author = Author.new
author.fee = 200.00
author.fee.should == 200.00
end

it "generates a predicate method to access a boolean property which returns false/false instead of 0/1" do
article = Article.new
article.published?.should == false
Expand Down
Binary file modified vendor/motion_data/ext/build-iPhoneSimulator/libext.a
Binary file not shown.

0 comments on commit b39636d

Please sign in to comment.