class ChinoRuby::Field
Class which defines the fields for the creation of a Schema
or a UserSchema
Attributes
indexed[RW]
name[RW]
type[RW]
Public Class Methods
new(type, name, indexed)
click to toggle source
-
type: type of the field in the Schema/UserSchema. Ex: 'string'
-
name: name of the field in the Schema/UserSchema
-
indexed: if true, the field will be indexed on the server. That means it can be used to make a search request
# File lib/chino_ruby/classes.rb, line 43 def initialize(type, name, indexed) check_string(type) check_string(name) check_boolean(indexed) self.type = type self.name = name self.indexed = indexed end
Public Instance Methods
to_json()
click to toggle source
Returns the values as a json
# File lib/chino_ruby/classes.rb, line 53 def to_json return {"type": type, "name": name, "indexed": indexed}.to_json end