This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
development: | |
:url: 'https://api.twilio.com/2010-04-01/Accounts/your_account_sid/Messages.json' | |
:auth_username: username | |
:auth_password: password | |
:phone_from: +1111111111 | |
staging: | |
:url: 'https://api.twilio.com/2010-04-01/Accounts/your_account_sid/Messages.json' | |
:auth_username: username | |
:auth_password: password |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module App | |
module Initializer | |
class << self | |
include EM::Deferrable | |
def load_app | |
#log that app loaded all files and ready to start from this point | |
succeed | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SMS | |
attr_reader :phone | |
def self.configure(texts:, **args) | |
const_set('TEXTS', texts) | |
end | |
def initialize(type:, phone:, **attrs) | |
@type = type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:texts: | |
registration: "Hello, %{name}! We are glad you are with us now! Sincerely yours, SMService!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyApplication extends Application { | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
RealmConfiguration config = new RealmConfiguration.Builder(context).build(); | |
Realm.setDefaultConfiguration(config); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyActivity extends Activity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
Realm realm = Realm.getDefaultInstance(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Realm realm = Realm.getInstance(this); | |
realm.beginTransaction(); | |
//... add or update objects here ... | |
realm.commitTransaction(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class University extends RealmObject { | |
@Index | |
private int id; | |
private String name; | |
// Standard getters & setters generated by your IDE… | |
} | |
Realm realm = Realm.getInstance(this); | |
realm.beginTransaction(); | |
University university = realm.createObject(University.class); // Create a new object | |
user.setName("John"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Student extends RealmObject { | |
@PrimaryKey | |
private String id; | |
@Required | |
private String name; | |
@Required | |
private Date birthday; | |
@Required | |
private String email; | |
// getters and setters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RealmModule(classes = {Student.class, University.class}) | |
public class SimpleRealmModule {} |
OlderNewer