Module: SfCli::Sf::Model::QueryMethods::ClassMethods
- Defined in:
- lib/sf_cli/sf/model/query_methods.rb
Instance Method Summary collapse
- #all ⇒ Object
- #find(id) ⇒ Object
- #limit(num) ⇒ Object
- #order(*field_names) ⇒ Object
- #pluck(field_name) ⇒ Object
- #select(*fields) ⇒ Object
- #take ⇒ Object
- #where(*expr) ⇒ Object
Instance Method Details
#all ⇒ Object
40 41 42 43 |
# File 'lib/sf_cli/sf/model/query_methods.rb', line 40 def all qc = QueryCondition.new(connection, self.name, self.field_names) qc.all end |
#find(id) ⇒ Object
24 25 26 |
# File 'lib/sf_cli/sf/model/query_methods.rb', line 24 def find(id) connection.find(name.to_sym, id, Object.const_get(name.to_sym)) end |
#limit(num) ⇒ Object
28 29 30 31 32 |
# File 'lib/sf_cli/sf/model/query_methods.rb', line 28 def limit(num) qc = QueryCondition.new(connection, self.name, self.field_names) qc.limit(num) qc end |
#order(*field_names) ⇒ Object
34 35 36 37 38 |
# File 'lib/sf_cli/sf/model/query_methods.rb', line 34 def order(*field_names) qc = QueryCondition.new(connection, self.name, self.field_names) qc.order(*field_names) qc end |
#pluck(field_name) ⇒ Object
45 46 47 48 |
# File 'lib/sf_cli/sf/model/query_methods.rb', line 45 def pluck(field_name) qc = QueryCondition.new(connection, self.name, self.field_names) qc.pluck(field_name) end |
#select(*fields) ⇒ Object
18 19 20 21 22 |
# File 'lib/sf_cli/sf/model/query_methods.rb', line 18 def select(*fields) qc = QueryCondition.new(connection, self.name, self.field_names) qc.select(*fields) return qc end |
#take ⇒ Object
50 51 52 53 |
# File 'lib/sf_cli/sf/model/query_methods.rb', line 50 def take qc = QueryCondition.new(connection, self.name, self.field_names) qc.take end |
#where(*expr) ⇒ Object
12 13 14 15 16 |
# File 'lib/sf_cli/sf/model/query_methods.rb', line 12 def where(*expr) qc = QueryCondition.new(connection, self.name, self.field_names) qc.where(*expr) return qc end |