- 授权协议: MIT
- 开发语言: Ruby
- 操作系统: 跨平台
- 软件首页: https://github.com/smartweb/LeanMotion
- 软件文档: https://github.com/smartweb/LeanMotion
软件介绍
LeanCloud ,一个为移动应用提供数据统计、数据存储、消息推送、发送短信、发送邮件等云服务商。
LeanMotion 是一个RubyMotion的Gem,可以更加方便地使用LeanCloud SDK。
用更Ruby的写法来操作LeanCloud的数据,类Rails的ActiveRecord,增删查改。
安装说明
1、安装gem
gem install lean_motion
2、创建项目
lean_motion create app-name
3、修改 app_delegate.rb
设置LeanCloud的App ID和App Key
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
分页(默认是20条记录/页)
Product.page(current_page, pagesize)
4、帐号相关 注册帐号
user = User.new user.username = '用户名,必须唯一' user.password = '必填' user.signUp
登录
User.login('用户名', '密码') do |user, error|
if !error
p '登录成功'
end
end
退出
User.logout
判断是否已登录
User.login? end
判断用户是否已存在
User.exist? username
新内容创业:我这样打造爆款IP
南立新、曲琳 / 机械工业出版社 / 2016-5-10 / 39.00
这是个内容创业爆棚的时代,在采访几十家内容创业公司,与一线最优秀的创业者独家对话之后,作者写作了这本书,其中包括对这个行业的真诚感触,以及希望沉淀下来的体系化思考。 本书共分三个部分讲述了爆红大号的内容创业模式和方法。其中第一部分,讲述了新的生产方式,即内容形态发展的现状--正在被塑造;第二部分,讲述了新的盈利探索,即从贩卖产品到贩卖内容的转变,该部分以多个案例进行佐证,内容翔实;第三部分,......一起来看看 《新内容创业:我这样打造爆款IP》 这本书的介绍吧!
