Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lean_motion

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lean_motion

  • 0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

LeanMotion

LeanMotion 是一个RubyMotion的Gem,可以更加方便地使用LeanCloud SDK。用更Ruby的写法来操作LeanCloud的数据,类Rails的ActiveRecord,增删查改。

安装说明

1、安装gem

gem install lean_motion

2、创建项目

lean_motion create app-name

3、设置LeanCloud的App ID和App Key 修改 app_delegate.rb

    app_id   = "your_app_id"
    app_key  = "your_app_key" 

4、运行

rake

使用说明

1、在LeanCloud后台创建一个Class,比如Product,并添加以下字段

name: String
description: String
url: String

2、添加model文件 product.rb,建议放在app/models/目录下

class Product
  include LM::Model

  fields :name, :description, :url
end

3、操作数据

新建产品

product = Product.new
product.name 		= 'iPhone 6'
product.description = '目前最好的智能手机'
product.url 		= 'http://www.apple.com'
product.save

产品数量

Product.count

查询产品

Product.where(:name=>'iPhone 6').find

获得第一条记录

Product.first

排序

Product.sort(:createdAt=>:desc).find

FAQs

Package last updated on 19 Oct 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc