repo
stringlengths
5
58
path
stringlengths
9
168
func_name
stringlengths
9
130
original_string
stringlengths
66
10.5k
language
stringclasses
1 value
code
stringlengths
66
10.5k
code_tokens
list
docstring
stringlengths
8
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
94
266
partition
stringclasses
1 value
yamasolutions/integral
app/helpers/integral/support_helper.rb
Integral.SupportHelper.method_missing
def method_missing(method, *args, &block) if method.to_s.end_with?('_path', '_url') if main_app.respond_to?(method) main_app.send(method, *args) else super end else super end end
ruby
def method_missing(method, *args, &block) if method.to_s.end_with?('_path', '_url') if main_app.respond_to?(method) main_app.send(method, *args) else super end else super end end
[ "def", "method_missing", "(", "method", ",", "*", "args", ",", "&", "block", ")", "if", "method", ".", "to_s", ".", "end_with?", "(", "'_path'", ",", "'_url'", ")", "if", "main_app", ".", "respond_to?", "(", "method", ")", "main_app", ".", "send", "(", "method", ",", "*", "args", ")", "else", "super", "end", "else", "super", "end", "end" ]
Override method_missing to check for main app routes before throwing exception
[ "Override", "method_missing", "to", "check", "for", "main", "app", "routes", "before", "throwing", "exception" ]
d8077b6658c8b6713d97b44ff0e136f212354a25
https://github.com/yamasolutions/integral/blob/d8077b6658c8b6713d97b44ff0e136f212354a25/app/helpers/integral/support_helper.rb#L35-L45
train
yamasolutions/integral
app/jobs/integral/newsletter_signup_job.rb
Integral.NewsletterSignupJob.perform
def perform(signup) return unless NewsletterSignup.api_available? gibbon = Gibbon::Request.new(api_key: Settings.newsletter_api_key) request_body = { email_address: signup.email, status: 'subscribed' } gibbon.lists(newsletter_list_id(signup)).members.create(body: request_body) # Update signup when the response is successful (in this case - if no error returned) signup.update_attribute(:processed, true) end
ruby
def perform(signup) return unless NewsletterSignup.api_available? gibbon = Gibbon::Request.new(api_key: Settings.newsletter_api_key) request_body = { email_address: signup.email, status: 'subscribed' } gibbon.lists(newsletter_list_id(signup)).members.create(body: request_body) # Update signup when the response is successful (in this case - if no error returned) signup.update_attribute(:processed, true) end
[ "def", "perform", "(", "signup", ")", "return", "unless", "NewsletterSignup", ".", "api_available?", "gibbon", "=", "Gibbon", "::", "Request", ".", "new", "(", "api_key", ":", "Settings", ".", "newsletter_api_key", ")", "request_body", "=", "{", "email_address", ":", "signup", ".", "email", ",", "status", ":", "'subscribed'", "}", "gibbon", ".", "lists", "(", "newsletter_list_id", "(", "signup", ")", ")", ".", "members", ".", "create", "(", "body", ":", "request_body", ")", "signup", ".", "update_attribute", "(", ":processed", ",", "true", ")", "end" ]
Attempts to signup an email to newsletter
[ "Attempts", "to", "signup", "an", "email", "to", "newsletter" ]
d8077b6658c8b6713d97b44ff0e136f212354a25
https://github.com/yamasolutions/integral/blob/d8077b6658c8b6713d97b44ff0e136f212354a25/app/jobs/integral/newsletter_signup_job.rb#L12-L21
train
yamasolutions/integral
app/mailers/integral/contact_mailer.rb
Integral.ContactMailer.forward_enquiry
def forward_enquiry(enquiry) @enquiry = enquiry sender = email_sender(enquiry.name, enquiry.email) mail subject: forwarding_subject(enquiry), from: sender, to: incoming_email_address, reply_to: sender end
ruby
def forward_enquiry(enquiry) @enquiry = enquiry sender = email_sender(enquiry.name, enquiry.email) mail subject: forwarding_subject(enquiry), from: sender, to: incoming_email_address, reply_to: sender end
[ "def", "forward_enquiry", "(", "enquiry", ")", "@enquiry", "=", "enquiry", "sender", "=", "email_sender", "(", "enquiry", ".", "name", ",", "enquiry", ".", "email", ")", "mail", "subject", ":", "forwarding_subject", "(", "enquiry", ")", ",", "from", ":", "sender", ",", "to", ":", "incoming_email_address", ",", "reply_to", ":", "sender", "end" ]
Send supplied enquiry to contact email @param enquiry [Enquiry] enquiry which the visitor has created
[ "Send", "supplied", "enquiry", "to", "contact", "email" ]
d8077b6658c8b6713d97b44ff0e136f212354a25
https://github.com/yamasolutions/integral/blob/d8077b6658c8b6713d97b44ff0e136f212354a25/app/mailers/integral/contact_mailer.rb#L10-L15
train
yamasolutions/integral
app/mailers/integral/contact_mailer.rb
Integral.ContactMailer.auto_reply
def auto_reply(enquiry) @enquiry = enquiry sender = email_sender(Integral::Settings.website_title, outgoing_email_address) mail subject: auto_reply_subject(enquiry), to: enquiry.email, from: sender, reply_to: sender end
ruby
def auto_reply(enquiry) @enquiry = enquiry sender = email_sender(Integral::Settings.website_title, outgoing_email_address) mail subject: auto_reply_subject(enquiry), to: enquiry.email, from: sender, reply_to: sender end
[ "def", "auto_reply", "(", "enquiry", ")", "@enquiry", "=", "enquiry", "sender", "=", "email_sender", "(", "Integral", "::", "Settings", ".", "website_title", ",", "outgoing_email_address", ")", "mail", "subject", ":", "auto_reply_subject", "(", "enquiry", ")", ",", "to", ":", "enquiry", ".", "email", ",", "from", ":", "sender", ",", "reply_to", ":", "sender", "end" ]
Send an auto reply to the visitor of the supplied enquiry @param enquiry [Enquiry] enquiry which the visitor has created
[ "Send", "an", "auto", "reply", "to", "the", "visitor", "of", "the", "supplied", "enquiry" ]
d8077b6658c8b6713d97b44ff0e136f212354a25
https://github.com/yamasolutions/integral/blob/d8077b6658c8b6713d97b44ff0e136f212354a25/app/mailers/integral/contact_mailer.rb#L20-L25
train
the-trash/the_comments
app/controllers/concerns/the_comments/controller.rb
TheComments.Controller.create
def create @comment = @commentable.comments.new comment_params if @comment.valid? @comment.save return render layout: false, partial: comment_partial(:comment), locals: { tree: @comment } end render json: { errors: @comment.errors } end
ruby
def create @comment = @commentable.comments.new comment_params if @comment.valid? @comment.save return render layout: false, partial: comment_partial(:comment), locals: { tree: @comment } end render json: { errors: @comment.errors } end
[ "def", "create", "@comment", "=", "@commentable", ".", "comments", ".", "new", "comment_params", "if", "@comment", ".", "valid?", "@comment", ".", "save", "return", "render", "layout", ":", "false", ",", "partial", ":", "comment_partial", "(", ":comment", ")", ",", "locals", ":", "{", "tree", ":", "@comment", "}", "end", "render", "json", ":", "{", "errors", ":", "@comment", ".", "errors", "}", "end" ]
BASE METHODS Public methods
[ "BASE", "METHODS", "Public", "methods" ]
5992b861f88100ed49058afad623b0d744fcc055
https://github.com/the-trash/the_comments/blob/5992b861f88100ed49058afad623b0d744fcc055/app/controllers/concerns/the_comments/controller.rb#L81-L88
train
the-trash/the_comments
app/models/concerns/the_comments/user.rb
TheComments.User.recalculate_my_comments_counter!
def recalculate_my_comments_counter! dcount = my_draft_comments.count pcount = my_published_comments.count update_attributes!({ my_draft_comments_count: dcount, my_published_comments_count: pcount, my_comments_count: dcount + pcount }) end
ruby
def recalculate_my_comments_counter! dcount = my_draft_comments.count pcount = my_published_comments.count update_attributes!({ my_draft_comments_count: dcount, my_published_comments_count: pcount, my_comments_count: dcount + pcount }) end
[ "def", "recalculate_my_comments_counter!", "dcount", "=", "my_draft_comments", ".", "count", "pcount", "=", "my_published_comments", ".", "count", "update_attributes!", "(", "{", "my_draft_comments_count", ":", "dcount", ",", "my_published_comments_count", ":", "pcount", ",", "my_comments_count", ":", "dcount", "+", "pcount", "}", ")", "end" ]
I think we shouldn't to have my_deleted_comments cache counter
[ "I", "think", "we", "shouldn", "t", "to", "have", "my_deleted_comments", "cache", "counter" ]
5992b861f88100ed49058afad623b0d744fcc055
https://github.com/the-trash/the_comments/blob/5992b861f88100ed49058afad623b0d744fcc055/app/models/concerns/the_comments/user.rb#L26-L34
train
Invoca/attr_default
lib/attr_default.rb
AttrDefault.ClassMethods.field_added
def field_added(name, type, args, options) if (default = options[:ruby_default]) attr_default name, default elsif (default = options[:default]) && default.is_a?(Proc) ActiveSupport::Deprecation.warn(':default => Proc has been deprecated. Use :ruby_default.', caller) attr_default name, default options.delete(:default) options[:ruby_default] = default end end
ruby
def field_added(name, type, args, options) if (default = options[:ruby_default]) attr_default name, default elsif (default = options[:default]) && default.is_a?(Proc) ActiveSupport::Deprecation.warn(':default => Proc has been deprecated. Use :ruby_default.', caller) attr_default name, default options.delete(:default) options[:ruby_default] = default end end
[ "def", "field_added", "(", "name", ",", "type", ",", "args", ",", "options", ")", "if", "(", "default", "=", "options", "[", ":ruby_default", "]", ")", "attr_default", "name", ",", "default", "elsif", "(", "default", "=", "options", "[", ":default", "]", ")", "&&", "default", ".", "is_a?", "(", "Proc", ")", "ActiveSupport", "::", "Deprecation", ".", "warn", "(", "':default => Proc has been deprecated. Use :ruby_default.'", ",", "caller", ")", "attr_default", "name", ",", "default", "options", ".", "delete", "(", ":default", ")", "options", "[", ":ruby_default", "]", "=", "default", "end", "end" ]
Hobo Fields field declaration
[ "Hobo", "Fields", "field", "declaration" ]
db28dec283ee47d76fe46067ff4c17110b1d2f69
https://github.com/Invoca/attr_default/blob/db28dec283ee47d76fe46067ff4c17110b1d2f69/lib/attr_default.rb#L29-L38
train
openxml/openxml-package
lib/openxml/rubyzip_fix.rb
Zip.InputStream.get_io
def get_io(io, offset=0) io = ::File.open(io, "rb") unless io.is_a?(IO) || io.is_a?(StringIO) io.seek(offset, ::IO::SEEK_SET) io end
ruby
def get_io(io, offset=0) io = ::File.open(io, "rb") unless io.is_a?(IO) || io.is_a?(StringIO) io.seek(offset, ::IO::SEEK_SET) io end
[ "def", "get_io", "(", "io", ",", "offset", "=", "0", ")", "io", "=", "::", "File", ".", "open", "(", "io", ",", "\"rb\"", ")", "unless", "io", ".", "is_a?", "(", "IO", ")", "||", "io", ".", "is_a?", "(", "StringIO", ")", "io", ".", "seek", "(", "offset", ",", "::", "IO", "::", "SEEK_SET", ")", "io", "end" ]
The problem in RubyZip 1.1.0 is that we only call `seek` when `io` is a File. We need to move the cursor to the right position when `io` is a StringIO as well.
[ "The", "problem", "in", "RubyZip", "1", ".", "1", ".", "0", "is", "that", "we", "only", "call", "seek", "when", "io", "is", "a", "File", ".", "We", "need", "to", "move", "the", "cursor", "to", "the", "right", "position", "when", "io", "is", "a", "StringIO", "as", "well", "." ]
742c8438396488bdc42c2143dbeb71b5a401aaaa
https://github.com/openxml/openxml-package/blob/742c8438396488bdc42c2143dbeb71b5a401aaaa/lib/openxml/rubyzip_fix.rb#L12-L16
train
AssemblyPayments/promisepay-ruby
lib/promisepay/resources/direct_debit_authority_resource.rb
Promisepay.DirectDebitAuthorityResource.find_all
def find_all(account_id, options = {}) response = JSON.parse(@client.get('direct_debit_authorities', { account_id: account_id }.merge(options)).body) direct_debit_authorities = response.key?('direct_debit_authorities') ? response['direct_debit_authorities'] : [] direct_debit_authorities.map { |attributes| Promisepay::DirectDebitAuthority.new(@client, attributes) } end
ruby
def find_all(account_id, options = {}) response = JSON.parse(@client.get('direct_debit_authorities', { account_id: account_id }.merge(options)).body) direct_debit_authorities = response.key?('direct_debit_authorities') ? response['direct_debit_authorities'] : [] direct_debit_authorities.map { |attributes| Promisepay::DirectDebitAuthority.new(@client, attributes) } end
[ "def", "find_all", "(", "account_id", ",", "options", "=", "{", "}", ")", "response", "=", "JSON", ".", "parse", "(", "@client", ".", "get", "(", "'direct_debit_authorities'", ",", "{", "account_id", ":", "account_id", "}", ".", "merge", "(", "options", ")", ")", ".", "body", ")", "direct_debit_authorities", "=", "response", ".", "key?", "(", "'direct_debit_authorities'", ")", "?", "response", "[", "'direct_debit_authorities'", "]", ":", "[", "]", "direct_debit_authorities", ".", "map", "{", "|", "attributes", "|", "Promisepay", "::", "DirectDebitAuthority", ".", "new", "(", "@client", ",", "attributes", ")", "}", "end" ]
List existing direct debit authorities for a given bank account @see https://reference.promisepay.com/#list-direct-debit-authorities @param account_id [String] account id to retrieve direct debit authorities from. @param options [Hash] Optional options. @option options [Integer] :limit Can ask for up to 200 users. default: 10 @option options [Integer] :offset Pagination help. default: 0 @return [Array<Promisepay::DirectDebitAuthority>] List of direct debit authorities.
[ "List", "existing", "direct", "debit", "authorities", "for", "a", "given", "bank", "account" ]
da0052cbc1a542fd2044c76c2536dd29da0fdda5
https://github.com/AssemblyPayments/promisepay-ruby/blob/da0052cbc1a542fd2044c76c2536dd29da0fdda5/lib/promisepay/resources/direct_debit_authority_resource.rb#L18-L22
train
AssemblyPayments/promisepay-ruby
lib/promisepay/resources/bank_account_resource.rb
Promisepay.BankAccountResource.validate
def validate(routing_number) response = @client.get('tools/routing_number', { routing_number: routing_number }, true) (response.status == 200) ? JSON.parse(response.body)['routing_number'] : {} end
ruby
def validate(routing_number) response = @client.get('tools/routing_number', { routing_number: routing_number }, true) (response.status == 200) ? JSON.parse(response.body)['routing_number'] : {} end
[ "def", "validate", "(", "routing_number", ")", "response", "=", "@client", ".", "get", "(", "'tools/routing_number'", ",", "{", "routing_number", ":", "routing_number", "}", ",", "true", ")", "(", "response", ".", "status", "==", "200", ")", "?", "JSON", ".", "parse", "(", "response", ".", "body", ")", "[", "'routing_number'", "]", ":", "{", "}", "end" ]
Validate a US bank routing number before creating an account. This can be used to provide on-demand verification, and further information of the bank information a User is providing. @see https://reference.promisepay.com/#validate-routing-number @param routing_number [String] Bank account Routing Number @return [Hash]
[ "Validate", "a", "US", "bank", "routing", "number", "before", "creating", "an", "account", ".", "This", "can", "be", "used", "to", "provide", "on", "-", "demand", "verification", "and", "further", "information", "of", "the", "bank", "information", "a", "User", "is", "providing", "." ]
da0052cbc1a542fd2044c76c2536dd29da0fdda5
https://github.com/AssemblyPayments/promisepay-ruby/blob/da0052cbc1a542fd2044c76c2536dd29da0fdda5/lib/promisepay/resources/bank_account_resource.rb#L41-L44
train
AssemblyPayments/promisepay-ruby
lib/promisepay/resources/company_resource.rb
Promisepay.CompanyResource.find_all
def find_all(options = {}) response = JSON.parse(@client.get('companies', options).body) users = response.key?('companies') ? response['companies'] : [] users.map { |attributes| Promisepay::Company.new(@client, attributes) } end
ruby
def find_all(options = {}) response = JSON.parse(@client.get('companies', options).body) users = response.key?('companies') ? response['companies'] : [] users.map { |attributes| Promisepay::Company.new(@client, attributes) } end
[ "def", "find_all", "(", "options", "=", "{", "}", ")", "response", "=", "JSON", ".", "parse", "(", "@client", ".", "get", "(", "'companies'", ",", "options", ")", ".", "body", ")", "users", "=", "response", ".", "key?", "(", "'companies'", ")", "?", "response", "[", "'companies'", "]", ":", "[", "]", "users", ".", "map", "{", "|", "attributes", "|", "Promisepay", "::", "Company", ".", "new", "(", "@client", ",", "attributes", ")", "}", "end" ]
List all companies for a marketplace @see https://reference.promisepay.com/#list-companies @param options [Hash] Optional options. @option options [Integer] :limit Can ask for up to 200 users. default: 10 @option options [Integer] :offset Pagination help. default: 0 @return [Array<Promisepay::Company>] List all companies for a marketplace.
[ "List", "all", "companies", "for", "a", "marketplace" ]
da0052cbc1a542fd2044c76c2536dd29da0fdda5
https://github.com/AssemblyPayments/promisepay-ruby/blob/da0052cbc1a542fd2044c76c2536dd29da0fdda5/lib/promisepay/resources/company_resource.rb#L17-L21
train
AssemblyPayments/promisepay-ruby
lib/promisepay/resources/company_resource.rb
Promisepay.CompanyResource.update
def update(attributes) response = JSON.parse(@client.patch("companies/#{attributes[:id]}", attributes).body) Promisepay::Company.new(@client, response['companies']) end
ruby
def update(attributes) response = JSON.parse(@client.patch("companies/#{attributes[:id]}", attributes).body) Promisepay::Company.new(@client, response['companies']) end
[ "def", "update", "(", "attributes", ")", "response", "=", "JSON", ".", "parse", "(", "@client", ".", "patch", "(", "\"companies/#{attributes[:id]}\"", ",", "attributes", ")", ".", "body", ")", "Promisepay", "::", "Company", ".", "new", "(", "@client", ",", "response", "[", "'companies'", "]", ")", "end" ]
Update a company for a user @see https://reference.promisepay.com/#update-company @param attributes [Hash] Company's attributes. @return [Promisepay::Company]
[ "Update", "a", "company", "for", "a", "user" ]
da0052cbc1a542fd2044c76c2536dd29da0fdda5
https://github.com/AssemblyPayments/promisepay-ruby/blob/da0052cbc1a542fd2044c76c2536dd29da0fdda5/lib/promisepay/resources/company_resource.rb#L54-L57
train
AssemblyPayments/promisepay-ruby
lib/promisepay/client.rb
Promisepay.Client.method_missing
def method_missing(name, *args, &block) if self.class.resources.keys.include?(name) resources[name] ||= self.class.resources[name].new(self) resources[name] else super end end
ruby
def method_missing(name, *args, &block) if self.class.resources.keys.include?(name) resources[name] ||= self.class.resources[name].new(self) resources[name] else super end end
[ "def", "method_missing", "(", "name", ",", "*", "args", ",", "&", "block", ")", "if", "self", ".", "class", ".", "resources", ".", "keys", ".", "include?", "(", "name", ")", "resources", "[", "name", "]", "||=", "self", ".", "class", ".", "resources", "[", "name", "]", ".", "new", "(", "self", ")", "resources", "[", "name", "]", "else", "super", "end", "end" ]
Catch calls for resources
[ "Catch", "calls", "for", "resources" ]
da0052cbc1a542fd2044c76c2536dd29da0fdda5
https://github.com/AssemblyPayments/promisepay-ruby/blob/da0052cbc1a542fd2044c76c2536dd29da0fdda5/lib/promisepay/client.rb#L151-L158
train
AssemblyPayments/promisepay-ruby
lib/promisepay/models/item.rb
Promisepay.Item.buyer
def buyer response = JSON.parse(@client.get("items/#{send(:id)}/buyers").body) Promisepay::User.new(@client, response['users']) end
ruby
def buyer response = JSON.parse(@client.get("items/#{send(:id)}/buyers").body) Promisepay::User.new(@client, response['users']) end
[ "def", "buyer", "response", "=", "JSON", ".", "parse", "(", "@client", ".", "get", "(", "\"items/#{send(:id)}/buyers\"", ")", ".", "body", ")", "Promisepay", "::", "User", ".", "new", "(", "@client", ",", "response", "[", "'users'", "]", ")", "end" ]
Show the buyer detail for a single item for a marketplace. @see https://reference.promisepay.com/#show-item-buyer @return [Promisepay::User]
[ "Show", "the", "buyer", "detail", "for", "a", "single", "item", "for", "a", "marketplace", "." ]
da0052cbc1a542fd2044c76c2536dd29da0fdda5
https://github.com/AssemblyPayments/promisepay-ruby/blob/da0052cbc1a542fd2044c76c2536dd29da0fdda5/lib/promisepay/models/item.rb#L32-L35
train
AssemblyPayments/promisepay-ruby
lib/promisepay/models/item.rb
Promisepay.Item.fees
def fees(options = {}) response = JSON.parse(@client.get("items/#{send(:id)}/fees", options).body) fees = response.key?('fees') ? response['fees'] : [] fees.map { |attributes| Promisepay::Fee.new(@client, attributes) } end
ruby
def fees(options = {}) response = JSON.parse(@client.get("items/#{send(:id)}/fees", options).body) fees = response.key?('fees') ? response['fees'] : [] fees.map { |attributes| Promisepay::Fee.new(@client, attributes) } end
[ "def", "fees", "(", "options", "=", "{", "}", ")", "response", "=", "JSON", ".", "parse", "(", "@client", ".", "get", "(", "\"items/#{send(:id)}/fees\"", ",", "options", ")", ".", "body", ")", "fees", "=", "response", ".", "key?", "(", "'fees'", ")", "?", "response", "[", "'fees'", "]", ":", "[", "]", "fees", ".", "map", "{", "|", "attributes", "|", "Promisepay", "::", "Fee", ".", "new", "(", "@client", ",", "attributes", ")", "}", "end" ]
Get fees associated to the item. @see https://reference.promisepay.com/#show-item-fees @param options [Hash] Optional options. @option options [Integer] :limit Can ask for up to 200 fees. default: 10 @option options [Integer] :offset Pagination help. default: 0 @return [Array<Promisepay::Fee>]
[ "Get", "fees", "associated", "to", "the", "item", "." ]
da0052cbc1a542fd2044c76c2536dd29da0fdda5
https://github.com/AssemblyPayments/promisepay-ruby/blob/da0052cbc1a542fd2044c76c2536dd29da0fdda5/lib/promisepay/models/item.rb#L56-L60
train
AssemblyPayments/promisepay-ruby
lib/promisepay/models/item.rb
Promisepay.Item.transactions
def transactions(options = {}) response = JSON.parse(@client.get("items/#{send(:id)}/transactions", options).body) transactions = response.key?('transactions') ? response['transactions'] : [] transactions.map { |attributes| Promisepay::Transaction.new(@client, attributes) } end
ruby
def transactions(options = {}) response = JSON.parse(@client.get("items/#{send(:id)}/transactions", options).body) transactions = response.key?('transactions') ? response['transactions'] : [] transactions.map { |attributes| Promisepay::Transaction.new(@client, attributes) } end
[ "def", "transactions", "(", "options", "=", "{", "}", ")", "response", "=", "JSON", ".", "parse", "(", "@client", ".", "get", "(", "\"items/#{send(:id)}/transactions\"", ",", "options", ")", ".", "body", ")", "transactions", "=", "response", ".", "key?", "(", "'transactions'", ")", "?", "response", "[", "'transactions'", "]", ":", "[", "]", "transactions", ".", "map", "{", "|", "attributes", "|", "Promisepay", "::", "Transaction", ".", "new", "(", "@client", ",", "attributes", ")", "}", "end" ]
Get historical transactions for the item. @see https://reference.promisepay.com/#list-item-transactions @param options [Hash] Optional options. @option options [Integer] :limit Can ask for up to 200 transactions. default: 10 @option options [Integer] :offset Pagination help. default: 0 @return [Array<Promisepay::Transaction>]
[ "Get", "historical", "transactions", "for", "the", "item", "." ]
da0052cbc1a542fd2044c76c2536dd29da0fdda5
https://github.com/AssemblyPayments/promisepay-ruby/blob/da0052cbc1a542fd2044c76c2536dd29da0fdda5/lib/promisepay/models/item.rb#L71-L75
train
AssemblyPayments/promisepay-ruby
lib/promisepay/models/item.rb
Promisepay.Item.batch_transactions
def batch_transactions(options = {}) response = JSON.parse(@client.get("items/#{send(:id)}/batch_transactions", options).body) batch_transactions = response.key?('batch_transactions') ? response['batch_transactions'] : [] batch_transactions.map { |attributes| Promisepay::BatchTransaction.new(@client, attributes) } end
ruby
def batch_transactions(options = {}) response = JSON.parse(@client.get("items/#{send(:id)}/batch_transactions", options).body) batch_transactions = response.key?('batch_transactions') ? response['batch_transactions'] : [] batch_transactions.map { |attributes| Promisepay::BatchTransaction.new(@client, attributes) } end
[ "def", "batch_transactions", "(", "options", "=", "{", "}", ")", "response", "=", "JSON", ".", "parse", "(", "@client", ".", "get", "(", "\"items/#{send(:id)}/batch_transactions\"", ",", "options", ")", ".", "body", ")", "batch_transactions", "=", "response", ".", "key?", "(", "'batch_transactions'", ")", "?", "response", "[", "'batch_transactions'", "]", ":", "[", "]", "batch_transactions", ".", "map", "{", "|", "attributes", "|", "Promisepay", "::", "BatchTransaction", ".", "new", "(", "@client", ",", "attributes", ")", "}", "end" ]
Get historical batch_transactions for the item. @see https://reference.promisepay.com/#list-item-batch-transactions @param options [Hash] Optional options. @option options [Integer] :limit Can ask for up to 200 transactions. default: 10 @option options [Integer] :offset Pagination help. default: 0 @return [Array<Promisepay::BatchTransaction>]
[ "Get", "historical", "batch_transactions", "for", "the", "item", "." ]
da0052cbc1a542fd2044c76c2536dd29da0fdda5
https://github.com/AssemblyPayments/promisepay-ruby/blob/da0052cbc1a542fd2044c76c2536dd29da0fdda5/lib/promisepay/models/item.rb#L86-L90
train
AssemblyPayments/promisepay-ruby
lib/promisepay/models/item.rb
Promisepay.Item.make_payment
def make_payment(options = {}) response = JSON.parse(@client.patch("items/#{send(:id)}/make_payment", options).body) @attributes = response['items'] true end
ruby
def make_payment(options = {}) response = JSON.parse(@client.patch("items/#{send(:id)}/make_payment", options).body) @attributes = response['items'] true end
[ "def", "make_payment", "(", "options", "=", "{", "}", ")", "response", "=", "JSON", ".", "parse", "(", "@client", ".", "patch", "(", "\"items/#{send(:id)}/make_payment\"", ",", "options", ")", ".", "body", ")", "@attributes", "=", "response", "[", "'items'", "]", "true", "end" ]
Make a payment for an Item. @see https://reference.promisepay.com/#make-payment @return [Boolean]
[ "Make", "a", "payment", "for", "an", "Item", "." ]
da0052cbc1a542fd2044c76c2536dd29da0fdda5
https://github.com/AssemblyPayments/promisepay-ruby/blob/da0052cbc1a542fd2044c76c2536dd29da0fdda5/lib/promisepay/models/item.rb#L117-L121
train
AssemblyPayments/promisepay-ruby
lib/promisepay/models/item.rb
Promisepay.Item.request_payment
def request_payment(options = {}) response = JSON.parse(@client.patch("items/#{send(:id)}/request_payment", options).body) @attributes = response['items'] true end
ruby
def request_payment(options = {}) response = JSON.parse(@client.patch("items/#{send(:id)}/request_payment", options).body) @attributes = response['items'] true end
[ "def", "request_payment", "(", "options", "=", "{", "}", ")", "response", "=", "JSON", ".", "parse", "(", "@client", ".", "patch", "(", "\"items/#{send(:id)}/request_payment\"", ",", "options", ")", ".", "body", ")", "@attributes", "=", "response", "[", "'items'", "]", "true", "end" ]
Request payment for an Item. @see https://reference.promisepay.com/#request-payment @return [Boolean]
[ "Request", "payment", "for", "an", "Item", "." ]
da0052cbc1a542fd2044c76c2536dd29da0fdda5
https://github.com/AssemblyPayments/promisepay-ruby/blob/da0052cbc1a542fd2044c76c2536dd29da0fdda5/lib/promisepay/models/item.rb#L128-L132
train
AssemblyPayments/promisepay-ruby
lib/promisepay/models/item.rb
Promisepay.Item.release_payment
def release_payment(options = {}) response = JSON.parse(@client.patch("items/#{send(:id)}/release_payment", options).body) @attributes = response['items'] true end
ruby
def release_payment(options = {}) response = JSON.parse(@client.patch("items/#{send(:id)}/release_payment", options).body) @attributes = response['items'] true end
[ "def", "release_payment", "(", "options", "=", "{", "}", ")", "response", "=", "JSON", ".", "parse", "(", "@client", ".", "patch", "(", "\"items/#{send(:id)}/release_payment\"", ",", "options", ")", ".", "body", ")", "@attributes", "=", "response", "[", "'items'", "]", "true", "end" ]
Release funds held in escrow from an Item with an Escrow or Escrow Partial Release payment type. @see https://reference.promisepay.com/#release-payment @return [Boolean]
[ "Release", "funds", "held", "in", "escrow", "from", "an", "Item", "with", "an", "Escrow", "or", "Escrow", "Partial", "Release", "payment", "type", "." ]
da0052cbc1a542fd2044c76c2536dd29da0fdda5
https://github.com/AssemblyPayments/promisepay-ruby/blob/da0052cbc1a542fd2044c76c2536dd29da0fdda5/lib/promisepay/models/item.rb#L140-L144
train
AssemblyPayments/promisepay-ruby
lib/promisepay/models/item.rb
Promisepay.Item.request_release
def request_release(options = {}) response = JSON.parse(@client.patch("items/#{send(:id)}/request_release", options).body) @attributes = response['items'] true end
ruby
def request_release(options = {}) response = JSON.parse(@client.patch("items/#{send(:id)}/request_release", options).body) @attributes = response['items'] true end
[ "def", "request_release", "(", "options", "=", "{", "}", ")", "response", "=", "JSON", ".", "parse", "(", "@client", ".", "patch", "(", "\"items/#{send(:id)}/request_release\"", ",", "options", ")", ".", "body", ")", "@attributes", "=", "response", "[", "'items'", "]", "true", "end" ]
Request release of funds held in escrow, from an Item with an Escrow or Escrow Partial Release payment type. @see https://reference.promisepay.com/#request-release @return [Boolean]
[ "Request", "release", "of", "funds", "held", "in", "escrow", "from", "an", "Item", "with", "an", "Escrow", "or", "Escrow", "Partial", "Release", "payment", "type", "." ]
da0052cbc1a542fd2044c76c2536dd29da0fdda5
https://github.com/AssemblyPayments/promisepay-ruby/blob/da0052cbc1a542fd2044c76c2536dd29da0fdda5/lib/promisepay/models/item.rb#L152-L156
train
AssemblyPayments/promisepay-ruby
lib/promisepay/models/item.rb
Promisepay.Item.acknowledge_wire
def acknowledge_wire(options = {}) response = JSON.parse(@client.patch("items/#{send(:id)}/acknowledge_wire", options).body) @attributes = response['items'] true end
ruby
def acknowledge_wire(options = {}) response = JSON.parse(@client.patch("items/#{send(:id)}/acknowledge_wire", options).body) @attributes = response['items'] true end
[ "def", "acknowledge_wire", "(", "options", "=", "{", "}", ")", "response", "=", "JSON", ".", "parse", "(", "@client", ".", "patch", "(", "\"items/#{send(:id)}/acknowledge_wire\"", ",", "options", ")", ".", "body", ")", "@attributes", "=", "response", "[", "'items'", "]", "true", "end" ]
Acknowledge that funds are being wired for payment. @see https://reference.promisepay.com/#acknowledge-wire-transfer @return [Boolean]
[ "Acknowledge", "that", "funds", "are", "being", "wired", "for", "payment", "." ]
da0052cbc1a542fd2044c76c2536dd29da0fdda5
https://github.com/AssemblyPayments/promisepay-ruby/blob/da0052cbc1a542fd2044c76c2536dd29da0fdda5/lib/promisepay/models/item.rb#L163-L167
train
AssemblyPayments/promisepay-ruby
lib/promisepay/models/item.rb
Promisepay.Item.revert_wire
def revert_wire(options = {}) response = JSON.parse(@client.patch("items/#{send(:id)}/revert_wire", options).body) @attributes = response['items'] true end
ruby
def revert_wire(options = {}) response = JSON.parse(@client.patch("items/#{send(:id)}/revert_wire", options).body) @attributes = response['items'] true end
[ "def", "revert_wire", "(", "options", "=", "{", "}", ")", "response", "=", "JSON", ".", "parse", "(", "@client", ".", "patch", "(", "\"items/#{send(:id)}/revert_wire\"", ",", "options", ")", ".", "body", ")", "@attributes", "=", "response", "[", "'items'", "]", "true", "end" ]
Revert an acknowledge wire Item Action. @see https://reference.promisepay.com/#revert-wire-transfer @return [Boolean]
[ "Revert", "an", "acknowledge", "wire", "Item", "Action", "." ]
da0052cbc1a542fd2044c76c2536dd29da0fdda5
https://github.com/AssemblyPayments/promisepay-ruby/blob/da0052cbc1a542fd2044c76c2536dd29da0fdda5/lib/promisepay/models/item.rb#L185-L189
train
AssemblyPayments/promisepay-ruby
lib/promisepay/models/item.rb
Promisepay.Item.request_refund
def request_refund(options = {}) response = JSON.parse(@client.patch("items/#{send(:id)}/request_refund", options).body) @attributes = response['items'] true end
ruby
def request_refund(options = {}) response = JSON.parse(@client.patch("items/#{send(:id)}/request_refund", options).body) @attributes = response['items'] true end
[ "def", "request_refund", "(", "options", "=", "{", "}", ")", "response", "=", "JSON", ".", "parse", "(", "@client", ".", "patch", "(", "\"items/#{send(:id)}/request_refund\"", ",", "options", ")", ".", "body", ")", "@attributes", "=", "response", "[", "'items'", "]", "true", "end" ]
Request a refund for an Item. @see https://reference.promisepay.com/#request-refund @return [Boolean]
[ "Request", "a", "refund", "for", "an", "Item", "." ]
da0052cbc1a542fd2044c76c2536dd29da0fdda5
https://github.com/AssemblyPayments/promisepay-ruby/blob/da0052cbc1a542fd2044c76c2536dd29da0fdda5/lib/promisepay/models/item.rb#L196-L200
train
AssemblyPayments/promisepay-ruby
lib/promisepay/models/item.rb
Promisepay.Item.raise_dispute
def raise_dispute(options = {}) response = JSON.parse(@client.patch("items/#{send(:id)}/raise_dispute", options).body) @attributes = response['items'] true end
ruby
def raise_dispute(options = {}) response = JSON.parse(@client.patch("items/#{send(:id)}/raise_dispute", options).body) @attributes = response['items'] true end
[ "def", "raise_dispute", "(", "options", "=", "{", "}", ")", "response", "=", "JSON", ".", "parse", "(", "@client", ".", "patch", "(", "\"items/#{send(:id)}/raise_dispute\"", ",", "options", ")", ".", "body", ")", "@attributes", "=", "response", "[", "'items'", "]", "true", "end" ]
Raise a dispute for the Item. @see https://reference.promisepay.com/#raise-dispute @return [Boolean]
[ "Raise", "a", "dispute", "for", "the", "Item", "." ]
da0052cbc1a542fd2044c76c2536dd29da0fdda5
https://github.com/AssemblyPayments/promisepay-ruby/blob/da0052cbc1a542fd2044c76c2536dd29da0fdda5/lib/promisepay/models/item.rb#L229-L233
train
AssemblyPayments/promisepay-ruby
lib/promisepay/resources/item_resource.rb
Promisepay.ItemResource.find_all
def find_all(options = {}) response = JSON.parse(@client.get('items', options).body) items = response.key?('items') ? response['items'] : [] items.map { |attributes| Promisepay::Item.new(@client, attributes) } end
ruby
def find_all(options = {}) response = JSON.parse(@client.get('items', options).body) items = response.key?('items') ? response['items'] : [] items.map { |attributes| Promisepay::Item.new(@client, attributes) } end
[ "def", "find_all", "(", "options", "=", "{", "}", ")", "response", "=", "JSON", ".", "parse", "(", "@client", ".", "get", "(", "'items'", ",", "options", ")", ".", "body", ")", "items", "=", "response", ".", "key?", "(", "'items'", ")", "?", "response", "[", "'items'", "]", ":", "[", "]", "items", ".", "map", "{", "|", "attributes", "|", "Promisepay", "::", "Item", ".", "new", "(", "@client", ",", "attributes", ")", "}", "end" ]
List all items for a marketplace @see https://reference.promisepay.com/#list-items @param options [Hash] Optional options. @option options [Integer] :limit Can ask for up to 200 items. default: 10 @option options [Integer] :offset Pagination help. default: 0 @return [Array<Promisepay::Item>] List all items for a marketplace.
[ "List", "all", "items", "for", "a", "marketplace" ]
da0052cbc1a542fd2044c76c2536dd29da0fdda5
https://github.com/AssemblyPayments/promisepay-ruby/blob/da0052cbc1a542fd2044c76c2536dd29da0fdda5/lib/promisepay/resources/item_resource.rb#L17-L21
train
AssemblyPayments/promisepay-ruby
lib/promisepay/resources/item_resource.rb
Promisepay.ItemResource.find
def find(id, type = :full) case type when :full response = JSON.parse(@client.get("items/#{id}").body) Promisepay::Item.new(@client, response['items']) when :status response = JSON.parse(@client.get("items/#{id}/status").body) Promisepay::Item.new(@client, response['items']) end end
ruby
def find(id, type = :full) case type when :full response = JSON.parse(@client.get("items/#{id}").body) Promisepay::Item.new(@client, response['items']) when :status response = JSON.parse(@client.get("items/#{id}/status").body) Promisepay::Item.new(@client, response['items']) end end
[ "def", "find", "(", "id", ",", "type", "=", ":full", ")", "case", "type", "when", ":full", "response", "=", "JSON", ".", "parse", "(", "@client", ".", "get", "(", "\"items/#{id}\"", ")", ".", "body", ")", "Promisepay", "::", "Item", ".", "new", "(", "@client", ",", "response", "[", "'items'", "]", ")", "when", ":status", "response", "=", "JSON", ".", "parse", "(", "@client", ".", "get", "(", "\"items/#{id}/status\"", ")", ".", "body", ")", "Promisepay", "::", "Item", ".", "new", "(", "@client", ",", "response", "[", "'items'", "]", ")", "end", "end" ]
Get a single item for a marketplace @see https://reference.promisepay.com/#show-item @param id [String] Marketplace item ID. @return [Promisepay::Item]
[ "Get", "a", "single", "item", "for", "a", "marketplace" ]
da0052cbc1a542fd2044c76c2536dd29da0fdda5
https://github.com/AssemblyPayments/promisepay-ruby/blob/da0052cbc1a542fd2044c76c2536dd29da0fdda5/lib/promisepay/resources/item_resource.rb#L30-L39
train
AssemblyPayments/promisepay-ruby
lib/promisepay/models/user.rb
Promisepay.User.bank_account
def bank_account response = JSON.parse(@client.get("users/#{send(:id)}/bank_accounts").body) Promisepay::BankAccount.new(@client, response['bank_accounts']) rescue Promisepay::UnprocessableEntity nil end
ruby
def bank_account response = JSON.parse(@client.get("users/#{send(:id)}/bank_accounts").body) Promisepay::BankAccount.new(@client, response['bank_accounts']) rescue Promisepay::UnprocessableEntity nil end
[ "def", "bank_account", "response", "=", "JSON", ".", "parse", "(", "@client", ".", "get", "(", "\"users/#{send(:id)}/bank_accounts\"", ")", ".", "body", ")", "Promisepay", "::", "BankAccount", ".", "new", "(", "@client", ",", "response", "[", "'bank_accounts'", "]", ")", "rescue", "Promisepay", "::", "UnprocessableEntity", "nil", "end" ]
Gets Bank account for a user on a marketplace. @see https://reference.promisepay.com/#show-user-bank-account @return [Promisepay::BankAccount]
[ "Gets", "Bank", "account", "for", "a", "user", "on", "a", "marketplace", "." ]
da0052cbc1a542fd2044c76c2536dd29da0fdda5
https://github.com/AssemblyPayments/promisepay-ruby/blob/da0052cbc1a542fd2044c76c2536dd29da0fdda5/lib/promisepay/models/user.rb#L34-L39
train
AssemblyPayments/promisepay-ruby
lib/promisepay/models/user.rb
Promisepay.User.card_account
def card_account response = JSON.parse(@client.get("users/#{send(:id)}/card_accounts").body) Promisepay::CardAccount.new(@client, response['card_accounts']) rescue Promisepay::UnprocessableEntity nil end
ruby
def card_account response = JSON.parse(@client.get("users/#{send(:id)}/card_accounts").body) Promisepay::CardAccount.new(@client, response['card_accounts']) rescue Promisepay::UnprocessableEntity nil end
[ "def", "card_account", "response", "=", "JSON", ".", "parse", "(", "@client", ".", "get", "(", "\"users/#{send(:id)}/card_accounts\"", ")", ".", "body", ")", "Promisepay", "::", "CardAccount", ".", "new", "(", "@client", ",", "response", "[", "'card_accounts'", "]", ")", "rescue", "Promisepay", "::", "UnprocessableEntity", "nil", "end" ]
Gets Card account for a user on a marketplace. @see https://reference.promisepay.com/#show-user-card-account @return [Promisepay::CardAccount]
[ "Gets", "Card", "account", "for", "a", "user", "on", "a", "marketplace", "." ]
da0052cbc1a542fd2044c76c2536dd29da0fdda5
https://github.com/AssemblyPayments/promisepay-ruby/blob/da0052cbc1a542fd2044c76c2536dd29da0fdda5/lib/promisepay/models/user.rb#L46-L51
train
AssemblyPayments/promisepay-ruby
lib/promisepay/models/user.rb
Promisepay.User.paypal_account
def paypal_account response = JSON.parse(@client.get("users/#{send(:id)}/paypal_accounts").body) Promisepay::PaypalAccount.new(@client, response['paypal_accounts']) rescue Promisepay::UnprocessableEntity nil end
ruby
def paypal_account response = JSON.parse(@client.get("users/#{send(:id)}/paypal_accounts").body) Promisepay::PaypalAccount.new(@client, response['paypal_accounts']) rescue Promisepay::UnprocessableEntity nil end
[ "def", "paypal_account", "response", "=", "JSON", ".", "parse", "(", "@client", ".", "get", "(", "\"users/#{send(:id)}/paypal_accounts\"", ")", ".", "body", ")", "Promisepay", "::", "PaypalAccount", ".", "new", "(", "@client", ",", "response", "[", "'paypal_accounts'", "]", ")", "rescue", "Promisepay", "::", "UnprocessableEntity", "nil", "end" ]
Gets PayPal account for a user on a marketplace. @see https://reference.promisepay.com/#show-user-paypal-account @return [Promisepay::PaypalAccount]
[ "Gets", "PayPal", "account", "for", "a", "user", "on", "a", "marketplace", "." ]
da0052cbc1a542fd2044c76c2536dd29da0fdda5
https://github.com/AssemblyPayments/promisepay-ruby/blob/da0052cbc1a542fd2044c76c2536dd29da0fdda5/lib/promisepay/models/user.rb#L58-L63
train
AssemblyPayments/promisepay-ruby
lib/promisepay/models/user.rb
Promisepay.User.disbursement_account
def disbursement_account(account_id) options = { account_id: account_id } JSON.parse(@client.post("users/#{send(:id)}/disbursement_account", options).body) true end
ruby
def disbursement_account(account_id) options = { account_id: account_id } JSON.parse(@client.post("users/#{send(:id)}/disbursement_account", options).body) true end
[ "def", "disbursement_account", "(", "account_id", ")", "options", "=", "{", "account_id", ":", "account_id", "}", "JSON", ".", "parse", "(", "@client", ".", "post", "(", "\"users/#{send(:id)}/disbursement_account\"", ",", "options", ")", ".", "body", ")", "true", "end" ]
Set the disbursement account for a user. @see https://reference.promisepay.com/#set-user-disbursement-account @return [Boolean]
[ "Set", "the", "disbursement", "account", "for", "a", "user", "." ]
da0052cbc1a542fd2044c76c2536dd29da0fdda5
https://github.com/AssemblyPayments/promisepay-ruby/blob/da0052cbc1a542fd2044c76c2536dd29da0fdda5/lib/promisepay/models/user.rb#L82-L86
train
AssemblyPayments/promisepay-ruby
lib/promisepay/models/user.rb
Promisepay.User.company
def company response = JSON.parse(@client.get("users/#{send(:id)}/companies").body) Promisepay::Company.new(@client, response['companies']) rescue Promisepay::NotFound nil end
ruby
def company response = JSON.parse(@client.get("users/#{send(:id)}/companies").body) Promisepay::Company.new(@client, response['companies']) rescue Promisepay::NotFound nil end
[ "def", "company", "response", "=", "JSON", ".", "parse", "(", "@client", ".", "get", "(", "\"users/#{send(:id)}/companies\"", ")", ".", "body", ")", "Promisepay", "::", "Company", ".", "new", "(", "@client", ",", "response", "[", "'companies'", "]", ")", "rescue", "Promisepay", "::", "NotFound", "nil", "end" ]
Gets company for a user on a marketplace. @see @return [Promisepay::Company]
[ "Gets", "company", "for", "a", "user", "on", "a", "marketplace", "." ]
da0052cbc1a542fd2044c76c2536dd29da0fdda5
https://github.com/AssemblyPayments/promisepay-ruby/blob/da0052cbc1a542fd2044c76c2536dd29da0fdda5/lib/promisepay/models/user.rb#L93-L98
train
AssemblyPayments/promisepay-ruby
lib/promisepay/resources/fee_resource.rb
Promisepay.FeeResource.find
def find(id) response = JSON.parse(@client.get("fees/#{id}").body) Promisepay::Fee.new(@client, response['fees']) end
ruby
def find(id) response = JSON.parse(@client.get("fees/#{id}").body) Promisepay::Fee.new(@client, response['fees']) end
[ "def", "find", "(", "id", ")", "response", "=", "JSON", ".", "parse", "(", "@client", ".", "get", "(", "\"fees/#{id}\"", ")", ".", "body", ")", "Promisepay", "::", "Fee", ".", "new", "(", "@client", ",", "response", "[", "'fees'", "]", ")", "end" ]
Get a single fee for a marketplace @see https://reference.promisepay.com/#show-fee @param id [String] Marketplace Fee ID. @return [Promisepay::Fee]
[ "Get", "a", "single", "fee", "for", "a", "marketplace" ]
da0052cbc1a542fd2044c76c2536dd29da0fdda5
https://github.com/AssemblyPayments/promisepay-ruby/blob/da0052cbc1a542fd2044c76c2536dd29da0fdda5/lib/promisepay/resources/fee_resource.rb#L30-L33
train
AssemblyPayments/promisepay-ruby
lib/promisepay/resources/fee_resource.rb
Promisepay.FeeResource.create
def create(attributes) response = JSON.parse(@client.post('fees', attributes).body) Promisepay::Fee.new(@client, response['fees']) end
ruby
def create(attributes) response = JSON.parse(@client.post('fees', attributes).body) Promisepay::Fee.new(@client, response['fees']) end
[ "def", "create", "(", "attributes", ")", "response", "=", "JSON", ".", "parse", "(", "@client", ".", "post", "(", "'fees'", ",", "attributes", ")", ".", "body", ")", "Promisepay", "::", "Fee", ".", "new", "(", "@client", ",", "response", "[", "'fees'", "]", ")", "end" ]
Create a fee for a marketplace @see https://reference.promisepay.com/#create-fee @param attributes [Hash] Item's attributes. @return [Promisepay::Item]
[ "Create", "a", "fee", "for", "a", "marketplace" ]
da0052cbc1a542fd2044c76c2536dd29da0fdda5
https://github.com/AssemblyPayments/promisepay-ruby/blob/da0052cbc1a542fd2044c76c2536dd29da0fdda5/lib/promisepay/resources/fee_resource.rb#L42-L45
train
AssemblyPayments/promisepay-ruby
lib/promisepay/models/wallet_account.rb
Promisepay.WalletAccount.withdraw
def withdraw(options = {}) response = JSON.parse(@client.post("wallet_accounts/#{send(:id)}/withdraw", options).body) response.key?('disbursements') ? response['disbursements'] : {} end
ruby
def withdraw(options = {}) response = JSON.parse(@client.post("wallet_accounts/#{send(:id)}/withdraw", options).body) response.key?('disbursements') ? response['disbursements'] : {} end
[ "def", "withdraw", "(", "options", "=", "{", "}", ")", "response", "=", "JSON", ".", "parse", "(", "@client", ".", "post", "(", "\"wallet_accounts/#{send(:id)}/withdraw\"", ",", "options", ")", ".", "body", ")", "response", ".", "key?", "(", "'disbursements'", ")", "?", "response", "[", "'disbursements'", "]", ":", "{", "}", "end" ]
Withdraw funds from a Wallet Account to a specified disbursement account. @see https://reference.promisepay.com/#withdraw-funds @param options [Hash] Optional options. @option options [String] :account_id Account to withdraw to. @option options [Integer] :amount Amount (in cents) to withdraw. @return [Hash]
[ "Withdraw", "funds", "from", "a", "Wallet", "Account", "to", "a", "specified", "disbursement", "account", "." ]
da0052cbc1a542fd2044c76c2536dd29da0fdda5
https://github.com/AssemblyPayments/promisepay-ruby/blob/da0052cbc1a542fd2044c76c2536dd29da0fdda5/lib/promisepay/models/wallet_account.rb#L13-L16
train
AssemblyPayments/promisepay-ruby
lib/promisepay/models/wallet_account.rb
Promisepay.WalletAccount.deposit
def deposit(options = {}) response = JSON.parse(@client.post("wallet_accounts/#{send(:id)}/deposit", options).body) response.key?('disbursements') ? response['disbursements'] : {} end
ruby
def deposit(options = {}) response = JSON.parse(@client.post("wallet_accounts/#{send(:id)}/deposit", options).body) response.key?('disbursements') ? response['disbursements'] : {} end
[ "def", "deposit", "(", "options", "=", "{", "}", ")", "response", "=", "JSON", ".", "parse", "(", "@client", ".", "post", "(", "\"wallet_accounts/#{send(:id)}/deposit\"", ",", "options", ")", ".", "body", ")", "response", ".", "key?", "(", "'disbursements'", ")", "?", "response", "[", "'disbursements'", "]", ":", "{", "}", "end" ]
Deposit funds to a Wallet Account from a specified payment account. @see https://reference.promisepay.com/#deposit-funds @param options [Hash] Optional options. @option options [String] :account_id Account to deposit from. @option options [Integer] :amount Amount (in cents) to deposit. @return [Hash]
[ "Deposit", "funds", "to", "a", "Wallet", "Account", "from", "a", "specified", "payment", "account", "." ]
da0052cbc1a542fd2044c76c2536dd29da0fdda5
https://github.com/AssemblyPayments/promisepay-ruby/blob/da0052cbc1a542fd2044c76c2536dd29da0fdda5/lib/promisepay/models/wallet_account.rb#L27-L30
train
AssemblyPayments/promisepay-ruby
lib/promisepay/models/wallet_account.rb
Promisepay.WalletAccount.user
def user response = JSON.parse(@client.get("wallet_accounts/#{send(:id)}/users").body) response.key?('users') ? Promisepay::User.new(@client, response['users']) : nil end
ruby
def user response = JSON.parse(@client.get("wallet_accounts/#{send(:id)}/users").body) response.key?('users') ? Promisepay::User.new(@client, response['users']) : nil end
[ "def", "user", "response", "=", "JSON", ".", "parse", "(", "@client", ".", "get", "(", "\"wallet_accounts/#{send(:id)}/users\"", ")", ".", "body", ")", "response", ".", "key?", "(", "'users'", ")", "?", "Promisepay", "::", "User", ".", "new", "(", "@client", ",", "response", "[", "'users'", "]", ")", ":", "nil", "end" ]
Show the User the Wallet Account is associated with @return [Promisepay::User]
[ "Show", "the", "User", "the", "Wallet", "Account", "is", "associated", "with" ]
da0052cbc1a542fd2044c76c2536dd29da0fdda5
https://github.com/AssemblyPayments/promisepay-ruby/blob/da0052cbc1a542fd2044c76c2536dd29da0fdda5/lib/promisepay/models/wallet_account.rb#L35-L38
train
AssemblyPayments/promisepay-ruby
lib/promisepay/models/transaction.rb
Promisepay.Transaction.fee
def fee response = JSON.parse(@client.get("transactions/#{send(:id)}/fees").body) response.key?('fees') ? Promisepay::Fee.new(@client, response['fees']) : nil end
ruby
def fee response = JSON.parse(@client.get("transactions/#{send(:id)}/fees").body) response.key?('fees') ? Promisepay::Fee.new(@client, response['fees']) : nil end
[ "def", "fee", "response", "=", "JSON", ".", "parse", "(", "@client", ".", "get", "(", "\"transactions/#{send(:id)}/fees\"", ")", ".", "body", ")", "response", ".", "key?", "(", "'fees'", ")", "?", "Promisepay", "::", "Fee", ".", "new", "(", "@client", ",", "response", "[", "'fees'", "]", ")", ":", "nil", "end" ]
Gets a transactions fee details if applicable. @see https://reference.promisepay.com/#shows-transaction-fees @return [Promisepay::Fee]
[ "Gets", "a", "transactions", "fee", "details", "if", "applicable", "." ]
da0052cbc1a542fd2044c76c2536dd29da0fdda5
https://github.com/AssemblyPayments/promisepay-ruby/blob/da0052cbc1a542fd2044c76c2536dd29da0fdda5/lib/promisepay/models/transaction.rb#L19-L22
train
AssemblyPayments/promisepay-ruby
lib/promisepay/resources/token_resource.rb
Promisepay.TokenResource.create
def create(type = :session, attributes) case type when :session if attributes && attributes[:fee_ids] && attributes[:fee_ids].is_a?(Array) attributes[:fee_ids] = attributes[:fee_ids].join(',') end response = @client.get('request_session_token', attributes) JSON.parse(response.body) when :eui attributes[:token_type] = 'eui' response = @client.post('token_auths/', attributes) JSON.parse(response.body) when :card attributes[:token_type] = 'card' response = @client.post('token_auths/', attributes) JSON.parse(response.body) when :approve attributes[:token_type] = '4' response = @client.post('token_auths/', attributes) JSON.parse(response.body) end end
ruby
def create(type = :session, attributes) case type when :session if attributes && attributes[:fee_ids] && attributes[:fee_ids].is_a?(Array) attributes[:fee_ids] = attributes[:fee_ids].join(',') end response = @client.get('request_session_token', attributes) JSON.parse(response.body) when :eui attributes[:token_type] = 'eui' response = @client.post('token_auths/', attributes) JSON.parse(response.body) when :card attributes[:token_type] = 'card' response = @client.post('token_auths/', attributes) JSON.parse(response.body) when :approve attributes[:token_type] = '4' response = @client.post('token_auths/', attributes) JSON.parse(response.body) end end
[ "def", "create", "(", "type", "=", ":session", ",", "attributes", ")", "case", "type", "when", ":session", "if", "attributes", "&&", "attributes", "[", ":fee_ids", "]", "&&", "attributes", "[", ":fee_ids", "]", ".", "is_a?", "(", "Array", ")", "attributes", "[", ":fee_ids", "]", "=", "attributes", "[", ":fee_ids", "]", ".", "join", "(", "','", ")", "end", "response", "=", "@client", ".", "get", "(", "'request_session_token'", ",", "attributes", ")", "JSON", ".", "parse", "(", "response", ".", "body", ")", "when", ":eui", "attributes", "[", ":token_type", "]", "=", "'eui'", "response", "=", "@client", ".", "post", "(", "'token_auths/'", ",", "attributes", ")", "JSON", ".", "parse", "(", "response", ".", "body", ")", "when", ":card", "attributes", "[", ":token_type", "]", "=", "'card'", "response", "=", "@client", ".", "post", "(", "'token_auths/'", ",", "attributes", ")", "JSON", ".", "parse", "(", "response", ".", "body", ")", "when", ":approve", "attributes", "[", ":token_type", "]", "=", "'4'", "response", "=", "@client", ".", "post", "(", "'token_auths/'", ",", "attributes", ")", "JSON", ".", "parse", "(", "response", ".", "body", ")", "end", "end" ]
Create a new token for an item @see https://reference.promisepay.com/#generate-card-token @param attributes [Hash] Token's attributes. @return [Hash]
[ "Create", "a", "new", "token", "for", "an", "item" ]
da0052cbc1a542fd2044c76c2536dd29da0fdda5
https://github.com/AssemblyPayments/promisepay-ruby/blob/da0052cbc1a542fd2044c76c2536dd29da0fdda5/lib/promisepay/resources/token_resource.rb#L11-L32
train
AssemblyPayments/promisepay-ruby
lib/promisepay/resources/charge_resource.rb
Promisepay.ChargeResource.find_all
def find_all(options = {}) response = JSON.parse(@client.get('charges', options).body) charges = response.key?('charges') ? response['charges'] : [] charges.map { |attributes| Promisepay::Charge.new(@client, attributes) } end
ruby
def find_all(options = {}) response = JSON.parse(@client.get('charges', options).body) charges = response.key?('charges') ? response['charges'] : [] charges.map { |attributes| Promisepay::Charge.new(@client, attributes) } end
[ "def", "find_all", "(", "options", "=", "{", "}", ")", "response", "=", "JSON", ".", "parse", "(", "@client", ".", "get", "(", "'charges'", ",", "options", ")", ".", "body", ")", "charges", "=", "response", ".", "key?", "(", "'charges'", ")", "?", "response", "[", "'charges'", "]", ":", "[", "]", "charges", ".", "map", "{", "|", "attributes", "|", "Promisepay", "::", "Charge", ".", "new", "(", "@client", ",", "attributes", ")", "}", "end" ]
List all charges @see https://reference.promisepay.com/#list-charges @param options [Hash] Optional options. @option options [Integer] :limit Can ask for up to 200 charges. default: 10 @option options [Integer] :offset Pagination help. default: 0 @return [Array<Promisepay::Charge>] List all charges.
[ "List", "all", "charges" ]
da0052cbc1a542fd2044c76c2536dd29da0fdda5
https://github.com/AssemblyPayments/promisepay-ruby/blob/da0052cbc1a542fd2044c76c2536dd29da0fdda5/lib/promisepay/resources/charge_resource.rb#L17-L21
train
DocRaptor/docraptor-ruby
lib/docraptor/api/doc_api.rb
DocRaptor.DocApi.create_async_doc
def create_async_doc(doc, opts = {}) data, _status_code, _headers = create_async_doc_with_http_info(doc, opts) return data end
ruby
def create_async_doc(doc, opts = {}) data, _status_code, _headers = create_async_doc_with_http_info(doc, opts) return data end
[ "def", "create_async_doc", "(", "doc", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "create_async_doc_with_http_info", "(", "doc", ",", "opts", ")", "return", "data", "end" ]
Creates a document asynchronously. You must use a callback url or the the returned status id and the status api to find out when it completes. Then use the download api to get the document. @param doc The document to be created. @param [Hash] opts the optional parameters @return [AsyncDoc]
[ "Creates", "a", "document", "asynchronously", ".", "You", "must", "use", "a", "callback", "url", "or", "the", "the", "returned", "status", "id", "and", "the", "status", "api", "to", "find", "out", "when", "it", "completes", ".", "Then", "use", "the", "download", "api", "to", "get", "the", "document", "." ]
b50a8ce235a5742afd729c7f24c9e30da6876f62
https://github.com/DocRaptor/docraptor-ruby/blob/b50a8ce235a5742afd729c7f24c9e30da6876f62/lib/docraptor/api/doc_api.rb#L28-L31
train
DocRaptor/docraptor-ruby
lib/docraptor/api/doc_api.rb
DocRaptor.DocApi.create_doc
def create_doc(doc, opts = {}) data, _status_code, _headers = create_doc_with_http_info(doc, opts) return data end
ruby
def create_doc(doc, opts = {}) data, _status_code, _headers = create_doc_with_http_info(doc, opts) return data end
[ "def", "create_doc", "(", "doc", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "create_doc_with_http_info", "(", "doc", ",", "opts", ")", "return", "data", "end" ]
Creates a document synchronously. @param doc The document to be created. @param [Hash] opts the optional parameters @return [String]
[ "Creates", "a", "document", "synchronously", "." ]
b50a8ce235a5742afd729c7f24c9e30da6876f62
https://github.com/DocRaptor/docraptor-ruby/blob/b50a8ce235a5742afd729c7f24c9e30da6876f62/lib/docraptor/api/doc_api.rb#L81-L84
train
DocRaptor/docraptor-ruby
lib/docraptor/api/doc_api.rb
DocRaptor.DocApi.get_async_doc
def get_async_doc(id, opts = {}) data, _status_code, _headers = get_async_doc_with_http_info(id, opts) return data end
ruby
def get_async_doc(id, opts = {}) data, _status_code, _headers = get_async_doc_with_http_info(id, opts) return data end
[ "def", "get_async_doc", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_async_doc_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Downloads a document. @param id The download_id returned from status request or a callback. @param [Hash] opts the optional parameters @return [String]
[ "Downloads", "a", "document", "." ]
b50a8ce235a5742afd729c7f24c9e30da6876f62
https://github.com/DocRaptor/docraptor-ruby/blob/b50a8ce235a5742afd729c7f24c9e30da6876f62/lib/docraptor/api/doc_api.rb#L134-L137
train
DocRaptor/docraptor-ruby
lib/docraptor/api/doc_api.rb
DocRaptor.DocApi.get_async_doc_status
def get_async_doc_status(id, opts = {}) data, _status_code, _headers = get_async_doc_status_with_http_info(id, opts) return data end
ruby
def get_async_doc_status(id, opts = {}) data, _status_code, _headers = get_async_doc_status_with_http_info(id, opts) return data end
[ "def", "get_async_doc_status", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_async_doc_status_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Check on the status of an asynchronously created document. @param id The status_id returned when creating an asynchronous document. @param [Hash] opts the optional parameters @return [AsyncDocStatus]
[ "Check", "on", "the", "status", "of", "an", "asynchronously", "created", "document", "." ]
b50a8ce235a5742afd729c7f24c9e30da6876f62
https://github.com/DocRaptor/docraptor-ruby/blob/b50a8ce235a5742afd729c7f24c9e30da6876f62/lib/docraptor/api/doc_api.rb#L187-L190
train
socializer/socializer
app/models/socializer/person.rb
Socializer.Person.likes
def likes verbs_of_interest = %w[like unlike] query = Activity.joins(:verb) .with_actor_id(id: guid) .with_target_id(id: nil) .merge(Verb.with_display_name(name: verbs_of_interest)) @likes ||= query.group(:activity_object_id).having("COUNT(1) % 2 == 1") end
ruby
def likes verbs_of_interest = %w[like unlike] query = Activity.joins(:verb) .with_actor_id(id: guid) .with_target_id(id: nil) .merge(Verb.with_display_name(name: verbs_of_interest)) @likes ||= query.group(:activity_object_id).having("COUNT(1) % 2 == 1") end
[ "def", "likes", "verbs_of_interest", "=", "%w[", "like", "unlike", "]", "query", "=", "Activity", ".", "joins", "(", ":verb", ")", ".", "with_actor_id", "(", "id", ":", "guid", ")", ".", "with_target_id", "(", "id", ":", "nil", ")", ".", "merge", "(", "Verb", ".", "with_display_name", "(", "name", ":", "verbs_of_interest", ")", ")", "@likes", "||=", "query", ".", "group", "(", ":activity_object_id", ")", ".", "having", "(", "\"COUNT(1) % 2 == 1\"", ")", "end" ]
A list of activities the user likes @example current_user.likes @return [ActiveRecord::Relation]
[ "A", "list", "of", "activities", "the", "user", "likes" ]
f9c3ee2ca26ca837d9f328815997c2ddface25fc
https://github.com/socializer/socializer/blob/f9c3ee2ca26ca837d9f328815997c2ddface25fc/app/models/socializer/person.rb#L177-L186
train
socializer/socializer
app/models/socializer/person.rb
Socializer.Person.likes?
def likes?(object) verbs_of_interest = %w[like unlike] query = Activity.joins(:verb) .with_activity_object_id(id: object.id) .with_actor_id(id: guid) .merge(Verb.with_display_name(name: verbs_of_interest)) query.count.odd? end
ruby
def likes?(object) verbs_of_interest = %w[like unlike] query = Activity.joins(:verb) .with_activity_object_id(id: object.id) .with_actor_id(id: guid) .merge(Verb.with_display_name(name: verbs_of_interest)) query.count.odd? end
[ "def", "likes?", "(", "object", ")", "verbs_of_interest", "=", "%w[", "like", "unlike", "]", "query", "=", "Activity", ".", "joins", "(", ":verb", ")", ".", "with_activity_object_id", "(", "id", ":", "object", ".", "id", ")", ".", "with_actor_id", "(", "id", ":", "guid", ")", ".", "merge", "(", "Verb", ".", "with_display_name", "(", "name", ":", "verbs_of_interest", ")", ")", "query", ".", "count", ".", "odd?", "end" ]
Checks if the person likes the object or not @example current_user.likes?(object) @param object [type] @return [TrueClass] if the person likes the object @return [FalseClass] if the person does not like the object
[ "Checks", "if", "the", "person", "likes", "the", "object", "or", "not" ]
f9c3ee2ca26ca837d9f328815997c2ddface25fc
https://github.com/socializer/socializer/blob/f9c3ee2ca26ca837d9f328815997c2ddface25fc/app/models/socializer/person.rb#L197-L206
train
socializer/socializer
app/services/socializer/create_activity.rb
Socializer.CreateActivity.add_audience_to_activity
def add_audience_to_activity(activity:) object_ids_array.each do |audience_id| privacy = audience_privacy(audience_id: audience_id) audience = activity.audiences.build(privacy: privacy) audience.activity_object_id = audience_id if privacy == limited_privacy end end
ruby
def add_audience_to_activity(activity:) object_ids_array.each do |audience_id| privacy = audience_privacy(audience_id: audience_id) audience = activity.audiences.build(privacy: privacy) audience.activity_object_id = audience_id if privacy == limited_privacy end end
[ "def", "add_audience_to_activity", "(", "activity", ":", ")", "object_ids_array", ".", "each", "do", "|", "audience_id", "|", "privacy", "=", "audience_privacy", "(", "audience_id", ":", "audience_id", ")", "audience", "=", "activity", ".", "audiences", ".", "build", "(", "privacy", ":", "privacy", ")", "audience", ".", "activity_object_id", "=", "audience_id", "if", "privacy", "==", "limited_privacy", "end", "end" ]
Add an audience to the activity @param activity: [Socializer::Activity] The activity to add the audience to
[ "Add", "an", "audience", "to", "the", "activity" ]
f9c3ee2ca26ca837d9f328815997c2ddface25fc
https://github.com/socializer/socializer/blob/f9c3ee2ca26ca837d9f328815997c2ddface25fc/app/services/socializer/create_activity.rb#L51-L58
train
socializer/socializer
app/services/socializer/audience_list.rb
Socializer.AudienceList.call
def call audiences = [merge_icon(list: privacy_hash(privacy_symbol: :public), icon: "fa-globe")] audiences << merge_icon(list: privacy_hash(privacy_symbol: :circles), icon: "fa-google-circles") # TODO: may use the avatar for the user audiences.concat(merge_icon(list: person_list, icon: "fa-user")) audiences.concat(merge_icon(list: audience_list(type: :circles), icon: "fa-google-circles")) audiences.concat(merge_icon(list: audience_list(type: :groups), icon: "fa-users")) end
ruby
def call audiences = [merge_icon(list: privacy_hash(privacy_symbol: :public), icon: "fa-globe")] audiences << merge_icon(list: privacy_hash(privacy_symbol: :circles), icon: "fa-google-circles") # TODO: may use the avatar for the user audiences.concat(merge_icon(list: person_list, icon: "fa-user")) audiences.concat(merge_icon(list: audience_list(type: :circles), icon: "fa-google-circles")) audiences.concat(merge_icon(list: audience_list(type: :groups), icon: "fa-users")) end
[ "def", "call", "audiences", "=", "[", "merge_icon", "(", "list", ":", "privacy_hash", "(", "privacy_symbol", ":", ":public", ")", ",", "icon", ":", "\"fa-globe\"", ")", "]", "audiences", "<<", "merge_icon", "(", "list", ":", "privacy_hash", "(", "privacy_symbol", ":", ":circles", ")", ",", "icon", ":", "\"fa-google-circles\"", ")", "audiences", ".", "concat", "(", "merge_icon", "(", "list", ":", "person_list", ",", "icon", ":", "\"fa-user\"", ")", ")", "audiences", ".", "concat", "(", "merge_icon", "(", "list", ":", "audience_list", "(", "type", ":", ":circles", ")", ",", "icon", ":", "\"fa-google-circles\"", ")", ")", "audiences", ".", "concat", "(", "merge_icon", "(", "list", ":", "audience_list", "(", "type", ":", ":groups", ")", ",", "icon", ":", "\"fa-users\"", ")", ")", "end" ]
Instance Methods Invoke the AudienceList instance. This is the primary public API method. Create the audience list @return [Array] DISCUSS: Should this return a Set instead of an Array
[ "Instance", "Methods", "Invoke", "the", "AudienceList", "instance", ".", "This", "is", "the", "primary", "public", "API", "method", ".", "Create", "the", "audience", "list" ]
f9c3ee2ca26ca837d9f328815997c2ddface25fc
https://github.com/socializer/socializer/blob/f9c3ee2ca26ca837d9f328815997c2ddface25fc/app/services/socializer/audience_list.rb#L51-L66
train
socializer/socializer
app/services/socializer/audience_list.rb
Socializer.AudienceList.person_list
def person_list return Person.none if @query.blank? result = select_display_name_alias_and_guids(query: Person) result.display_name_like(query: "%#{@query}%") end
ruby
def person_list return Person.none if @query.blank? result = select_display_name_alias_and_guids(query: Person) result.display_name_like(query: "%#{@query}%") end
[ "def", "person_list", "return", "Person", ".", "none", "if", "@query", ".", "blank?", "result", "=", "select_display_name_alias_and_guids", "(", "query", ":", "Person", ")", "result", ".", "display_name_like", "(", "query", ":", "\"%#{@query}%\"", ")", "end" ]
Build the list of people based on the query @return [ActiveRecord::NullRelation] If query is nil or "", Person.none is returned @return [ActiveRecord::Relation] If a query is provided the display_name and guid for all records that match the query
[ "Build", "the", "list", "of", "people", "based", "on", "the", "query" ]
f9c3ee2ca26ca837d9f328815997c2ddface25fc
https://github.com/socializer/socializer/blob/f9c3ee2ca26ca837d9f328815997c2ddface25fc/app/services/socializer/audience_list.rb#L107-L112
train
socializer/socializer
app/models/socializer/activity_object.rb
Socializer.ActivityObject.liked_by
def liked_by # subquery = Activity.where(activity_object_id: id) # people = Person.joins(activity_object: { actor_activities: :verb }) # .merge(subquery) # likers = people.merge(Verb.by_display_name("like")) # unlikers = people.merge(Verb.by_display_name("unlike")).pluck(:id) query = Activity.joins(:verb).with_activity_object_id(id: id) likers = query.merge(Verb.with_display_name(name: "like")) unlikers = query.merge(Verb.with_display_name(name: "unlike")) people = likers.map(&:actor) unlikers.each do |activity| people.delete_at people.index(activity.actor) end people end
ruby
def liked_by # subquery = Activity.where(activity_object_id: id) # people = Person.joins(activity_object: { actor_activities: :verb }) # .merge(subquery) # likers = people.merge(Verb.by_display_name("like")) # unlikers = people.merge(Verb.by_display_name("unlike")).pluck(:id) query = Activity.joins(:verb).with_activity_object_id(id: id) likers = query.merge(Verb.with_display_name(name: "like")) unlikers = query.merge(Verb.with_display_name(name: "unlike")) people = likers.map(&:actor) unlikers.each do |activity| people.delete_at people.index(activity.actor) end people end
[ "def", "liked_by", "query", "=", "Activity", ".", "joins", "(", ":verb", ")", ".", "with_activity_object_id", "(", "id", ":", "id", ")", "likers", "=", "query", ".", "merge", "(", "Verb", ".", "with_display_name", "(", "name", ":", "\"like\"", ")", ")", "unlikers", "=", "query", ".", "merge", "(", "Verb", ".", "with_display_name", "(", "name", ":", "\"unlike\"", ")", ")", "people", "=", "likers", ".", "map", "(", "&", ":actor", ")", "unlikers", ".", "each", "do", "|", "activity", "|", "people", ".", "delete_at", "people", ".", "index", "(", "activity", ".", "actor", ")", "end", "people", "end" ]
Instance Methods A list of people that like this activity object @return [Array] REFACTOR: DRY this up. Reduce database calls
[ "Instance", "Methods", "A", "list", "of", "people", "that", "like", "this", "activity", "object" ]
f9c3ee2ca26ca837d9f328815997c2ddface25fc
https://github.com/socializer/socializer/blob/f9c3ee2ca26ca837d9f328815997c2ddface25fc/app/models/socializer/activity_object.rb#L130-L147
train
socializer/socializer
app/decorators/socializer/application_decorator.rb
Socializer.ApplicationDecorator.time_ago
def time_ago(options: {}) data = { behavior: "tooltip-on-hover", time_ago: "moment.js" } options.reverse_merge!(title: created_updated_tooltip_text, data: data) time_tag(options: options) end
ruby
def time_ago(options: {}) data = { behavior: "tooltip-on-hover", time_ago: "moment.js" } options.reverse_merge!(title: created_updated_tooltip_text, data: data) time_tag(options: options) end
[ "def", "time_ago", "(", "options", ":", "{", "}", ")", "data", "=", "{", "behavior", ":", "\"tooltip-on-hover\"", ",", "time_ago", ":", "\"moment.js\"", "}", "options", ".", "reverse_merge!", "(", "title", ":", "created_updated_tooltip_text", ",", "data", ":", "data", ")", "time_tag", "(", "options", ":", "options", ")", "end" ]
Builds an HTML time tag @param options [Hash] @return [String] An HTML time tag
[ "Builds", "an", "HTML", "time", "tag" ]
f9c3ee2ca26ca837d9f328815997c2ddface25fc
https://github.com/socializer/socializer/blob/f9c3ee2ca26ca837d9f328815997c2ddface25fc/app/decorators/socializer/application_decorator.rb#L26-L32
train
socializer/socializer
app/services/socializer/add_default_circles.rb
Socializer.AddDefaultCircles.call
def call create_circle(display_name: "Friends", content: friends_content) create_circle(display_name: "Family", content: family_content) create_circle(display_name: "Acquaintances", content: acquaintances_content) create_circle(display_name: "Following", content: following_content) end
ruby
def call create_circle(display_name: "Friends", content: friends_content) create_circle(display_name: "Family", content: family_content) create_circle(display_name: "Acquaintances", content: acquaintances_content) create_circle(display_name: "Following", content: following_content) end
[ "def", "call", "create_circle", "(", "display_name", ":", "\"Friends\"", ",", "content", ":", "friends_content", ")", "create_circle", "(", "display_name", ":", "\"Family\"", ",", "content", ":", "family_content", ")", "create_circle", "(", "display_name", ":", "\"Acquaintances\"", ",", "content", ":", "acquaintances_content", ")", "create_circle", "(", "display_name", ":", "\"Following\"", ",", "content", ":", "following_content", ")", "end" ]
Instance Methods Invoke the AddDefaultCircles instance. This is the primary public API method. Add the default circles
[ "Instance", "Methods", "Invoke", "the", "AddDefaultCircles", "instance", ".", "This", "is", "the", "primary", "public", "API", "method", ".", "Add", "the", "default", "circles" ]
f9c3ee2ca26ca837d9f328815997c2ddface25fc
https://github.com/socializer/socializer/blob/f9c3ee2ca26ca837d9f328815997c2ddface25fc/app/services/socializer/add_default_circles.rb#L47-L59
train
socializer/socializer
app/services/socializer/activity_audience_list.rb
Socializer.ActivityAudienceList.call
def call list = [] @activity.audiences.each do |audience| if audience.public? message = I18n.t("tooltip.public", scope: "socializer.activities.audiences.index") return [message] end list.concat(audience_list(audience: audience)) end list.unshift(@activity.activitable_actor.activitable.display_name) end
ruby
def call list = [] @activity.audiences.each do |audience| if audience.public? message = I18n.t("tooltip.public", scope: "socializer.activities.audiences.index") return [message] end list.concat(audience_list(audience: audience)) end list.unshift(@activity.activitable_actor.activitable.display_name) end
[ "def", "call", "list", "=", "[", "]", "@activity", ".", "audiences", ".", "each", "do", "|", "audience", "|", "if", "audience", ".", "public?", "message", "=", "I18n", ".", "t", "(", "\"tooltip.public\"", ",", "scope", ":", "\"socializer.activities.audiences.index\"", ")", "return", "[", "message", "]", "end", "list", ".", "concat", "(", "audience_list", "(", "audience", ":", "audience", ")", ")", "end", "list", ".", "unshift", "(", "@activity", ".", "activitable_actor", ".", "activitable", ".", "display_name", ")", "end" ]
Instance Methods Invoke the ActivityAudienceList instance. This is the primary public API method. @return [Array]
[ "Instance", "Methods", "Invoke", "the", "ActivityAudienceList", "instance", ".", "This", "is", "the", "primary", "public", "API", "method", "." ]
f9c3ee2ca26ca837d9f328815997c2ddface25fc
https://github.com/socializer/socializer/blob/f9c3ee2ca26ca837d9f328815997c2ddface25fc/app/services/socializer/activity_audience_list.rb#L49-L63
train
socializer/socializer
app/services/socializer/activity_audience_list.rb
Socializer.ActivityAudienceList.limited_audience_list
def limited_audience_list(activitable:) # The target audience is either a group or a person, # which means we can add it as it is in the audience list. return [activitable.display_name] unless activitable.is_a?(Circle) activitable.contacts.pluck(:display_name) end
ruby
def limited_audience_list(activitable:) # The target audience is either a group or a person, # which means we can add it as it is in the audience list. return [activitable.display_name] unless activitable.is_a?(Circle) activitable.contacts.pluck(:display_name) end
[ "def", "limited_audience_list", "(", "activitable", ":", ")", "return", "[", "activitable", ".", "display_name", "]", "unless", "activitable", ".", "is_a?", "(", "Circle", ")", "activitable", ".", "contacts", ".", "pluck", "(", ":display_name", ")", "end" ]
In the case of LIMITED audience, then go through all the audience circles and add contacts from those circles in the list of allowed audience.
[ "In", "the", "case", "of", "LIMITED", "audience", "then", "go", "through", "all", "the", "audience", "circles", "and", "add", "contacts", "from", "those", "circles", "in", "the", "list", "of", "allowed", "audience", "." ]
f9c3ee2ca26ca837d9f328815997c2ddface25fc
https://github.com/socializer/socializer/blob/f9c3ee2ca26ca837d9f328815997c2ddface25fc/app/services/socializer/activity_audience_list.rb#L82-L88
train
socializer/socializer
app/models/socializer/activity.rb
Socializer.Activity.comments
def comments activitable_type = ActivityObject.with_activitable_type(type: Comment.name) @comments ||= children.joins(:activitable_object) .merge(activitable_type) end
ruby
def comments activitable_type = ActivityObject.with_activitable_type(type: Comment.name) @comments ||= children.joins(:activitable_object) .merge(activitable_type) end
[ "def", "comments", "activitable_type", "=", "ActivityObject", ".", "with_activitable_type", "(", "type", ":", "Comment", ".", "name", ")", "@comments", "||=", "children", ".", "joins", "(", ":activitable_object", ")", ".", "merge", "(", "activitable_type", ")", "end" ]
Retrieves the comments for an activity @return [ActiveRecord::AssociationRelation] a collection of {Socializer::Activity} objects
[ "Retrieves", "the", "comments", "for", "an", "activity" ]
f9c3ee2ca26ca837d9f328815997c2ddface25fc
https://github.com/socializer/socializer/blob/f9c3ee2ca26ca837d9f328815997c2ddface25fc/app/models/socializer/activity.rb#L339-L345
train
socializer/socializer
app/decorators/socializer/activity_object_decorator.rb
Socializer.ActivityObjectDecorator.link_to_like_or_unlike
def link_to_like_or_unlike return unless helpers.current_user options = current_user_likes? ? like_options : unlike_options like_or_unlike_link(options: options) end
ruby
def link_to_like_or_unlike return unless helpers.current_user options = current_user_likes? ? like_options : unlike_options like_or_unlike_link(options: options) end
[ "def", "link_to_like_or_unlike", "return", "unless", "helpers", ".", "current_user", "options", "=", "current_user_likes?", "?", "like_options", ":", "unlike_options", "like_or_unlike_link", "(", "options", ":", "options", ")", "end" ]
Builds the like or unlike link @return [String] the html needed to display the like/unlike link
[ "Builds", "the", "like", "or", "unlike", "link" ]
f9c3ee2ca26ca837d9f328815997c2ddface25fc
https://github.com/socializer/socializer/blob/f9c3ee2ca26ca837d9f328815997c2ddface25fc/app/decorators/socializer/activity_object_decorator.rb#L30-L36
train
socializer/socializer
app/decorators/socializer/person_decorator.rb
Socializer.PersonDecorator.image_tag_avatar
def image_tag_avatar(size: nil, css_class: nil, alt: "Avatar", title: nil) width, height = parse_size(size: size) if size helpers.tag.img(src: avatar_url, class: css_class, alt: alt, title: title, width: width, height: height, data: { behavior: "tooltip-on-hover" }) end
ruby
def image_tag_avatar(size: nil, css_class: nil, alt: "Avatar", title: nil) width, height = parse_size(size: size) if size helpers.tag.img(src: avatar_url, class: css_class, alt: alt, title: title, width: width, height: height, data: { behavior: "tooltip-on-hover" }) end
[ "def", "image_tag_avatar", "(", "size", ":", "nil", ",", "css_class", ":", "nil", ",", "alt", ":", "\"Avatar\"", ",", "title", ":", "nil", ")", "width", ",", "height", "=", "parse_size", "(", "size", ":", "size", ")", "if", "size", "helpers", ".", "tag", ".", "img", "(", "src", ":", "avatar_url", ",", "class", ":", "css_class", ",", "alt", ":", "alt", ",", "title", ":", "title", ",", "width", ":", "width", ",", "height", ":", "height", ",", "data", ":", "{", "behavior", ":", "\"tooltip-on-hover\"", "}", ")", "end" ]
Creates an image tag for the persons avatar @param size: nil [String] @param css_class: nil [String] @param alt: "Avatar" [String] @param title: nil [String] @return [String] An HTML image tag
[ "Creates", "an", "image", "tag", "for", "the", "persons", "avatar" ]
f9c3ee2ca26ca837d9f328815997c2ddface25fc
https://github.com/socializer/socializer/blob/f9c3ee2ca26ca837d9f328815997c2ddface25fc/app/decorators/socializer/person_decorator.rb#L111-L117
train
socializer/socializer
app/decorators/socializer/person_decorator.rb
Socializer.PersonDecorator.link_to_avatar
def link_to_avatar helpers.link_to(image_tag_avatar(title: model.display_name), helpers.person_activities_path(person_id: model.id)) end
ruby
def link_to_avatar helpers.link_to(image_tag_avatar(title: model.display_name), helpers.person_activities_path(person_id: model.id)) end
[ "def", "link_to_avatar", "helpers", ".", "link_to", "(", "image_tag_avatar", "(", "title", ":", "model", ".", "display_name", ")", ",", "helpers", ".", "person_activities_path", "(", "person_id", ":", "model", ".", "id", ")", ")", "end" ]
Creates a link to the persons profile with their avatar as the content @return [String] An HTML a tag
[ "Creates", "a", "link", "to", "the", "persons", "profile", "with", "their", "avatar", "as", "the", "content" ]
f9c3ee2ca26ca837d9f328815997c2ddface25fc
https://github.com/socializer/socializer/blob/f9c3ee2ca26ca837d9f328815997c2ddface25fc/app/decorators/socializer/person_decorator.rb#L122-L125
train
socializer/socializer
app/decorators/socializer/person_decorator.rb
Socializer.PersonDecorator.toolbar_stream_links
def toolbar_stream_links list = combine_circles_and_memberships return if list.blank? html = [toolbar_links(list[0..2])] html << toolbar_dropdown(list[3..(list.size)]) helpers.safe_join(html) end
ruby
def toolbar_stream_links list = combine_circles_and_memberships return if list.blank? html = [toolbar_links(list[0..2])] html << toolbar_dropdown(list[3..(list.size)]) helpers.safe_join(html) end
[ "def", "toolbar_stream_links", "list", "=", "combine_circles_and_memberships", "return", "if", "list", ".", "blank?", "html", "=", "[", "toolbar_links", "(", "list", "[", "0", "..", "2", "]", ")", "]", "html", "<<", "toolbar_dropdown", "(", "list", "[", "3", "..", "(", "list", ".", "size", ")", "]", ")", "helpers", ".", "safe_join", "(", "html", ")", "end" ]
Builds the links for the shared toolbar @return [String] the html needed to display the toolbar links
[ "Builds", "the", "links", "for", "the", "shared", "toolbar" ]
f9c3ee2ca26ca837d9f328815997c2ddface25fc
https://github.com/socializer/socializer/blob/f9c3ee2ca26ca837d9f328815997c2ddface25fc/app/decorators/socializer/person_decorator.rb#L144-L152
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_contact
def get_contact(id, opts = {}) data, _status_code, _headers = get_contact_with_http_info(id, opts) return data end
ruby
def get_contact(id, opts = {}) data, _status_code, _headers = get_contact_with_http_info(id, opts) return data end
[ "def", "get_contact", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_contact_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns a specific student contact @param id @param [Hash] opts the optional parameters @return [ContactResponse]
[ "Returns", "a", "specific", "student", "contact" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L28-L31
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_contacts_for_student
def get_contacts_for_student(id, opts = {}) data, _status_code, _headers = get_contacts_for_student_with_http_info(id, opts) return data end
ruby
def get_contacts_for_student(id, opts = {}) data, _status_code, _headers = get_contacts_for_student_with_http_info(id, opts) return data end
[ "def", "get_contacts_for_student", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_contacts_for_student_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns the contacts for a student @param id @param [Hash] opts the optional parameters @option opts [Integer] :limit @option opts [String] :starting_after @option opts [String] :ending_before @return [ContactsResponse]
[ "Returns", "the", "contacts", "for", "a", "student" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L140-L143
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_course
def get_course(id, opts = {}) data, _status_code, _headers = get_course_with_http_info(id, opts) return data end
ruby
def get_course(id, opts = {}) data, _status_code, _headers = get_course_with_http_info(id, opts) return data end
[ "def", "get_course", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_course_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns a specific course @param id @param [Hash] opts the optional parameters @return [CourseResponse]
[ "Returns", "a", "specific", "course" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L199-L202
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_course_for_section
def get_course_for_section(id, opts = {}) data, _status_code, _headers = get_course_for_section_with_http_info(id, opts) return data end
ruby
def get_course_for_section(id, opts = {}) data, _status_code, _headers = get_course_for_section_with_http_info(id, opts) return data end
[ "def", "get_course_for_section", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_course_for_section_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns the course for a section @param id @param [Hash] opts the optional parameters @return [CourseResponse]
[ "Returns", "the", "course", "for", "a", "section" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L252-L255
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_district
def get_district(id, opts = {}) data, _status_code, _headers = get_district_with_http_info(id, opts) return data end
ruby
def get_district(id, opts = {}) data, _status_code, _headers = get_district_with_http_info(id, opts) return data end
[ "def", "get_district", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_district_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns a specific district @param id @param [Hash] opts the optional parameters @return [DistrictResponse]
[ "Returns", "a", "specific", "district" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L361-L364
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_district_admin
def get_district_admin(id, opts = {}) data, _status_code, _headers = get_district_admin_with_http_info(id, opts) return data end
ruby
def get_district_admin(id, opts = {}) data, _status_code, _headers = get_district_admin_with_http_info(id, opts) return data end
[ "def", "get_district_admin", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_district_admin_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns a specific district admin @param id @param [Hash] opts the optional parameters @return [DistrictAdminResponse]
[ "Returns", "a", "specific", "district", "admin" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L414-L417
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_district_for_contact
def get_district_for_contact(id, opts = {}) data, _status_code, _headers = get_district_for_contact_with_http_info(id, opts) return data end
ruby
def get_district_for_contact(id, opts = {}) data, _status_code, _headers = get_district_for_contact_with_http_info(id, opts) return data end
[ "def", "get_district_for_contact", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_district_for_contact_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns the district for a student contact @param id @param [Hash] opts the optional parameters @return [DistrictResponse]
[ "Returns", "the", "district", "for", "a", "student", "contact" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L523-L526
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_district_for_course
def get_district_for_course(id, opts = {}) data, _status_code, _headers = get_district_for_course_with_http_info(id, opts) return data end
ruby
def get_district_for_course(id, opts = {}) data, _status_code, _headers = get_district_for_course_with_http_info(id, opts) return data end
[ "def", "get_district_for_course", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_district_for_course_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns the district for a course @param id @param [Hash] opts the optional parameters @return [DistrictResponse]
[ "Returns", "the", "district", "for", "a", "course" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L576-L579
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_district_for_district_admin
def get_district_for_district_admin(id, opts = {}) data, _status_code, _headers = get_district_for_district_admin_with_http_info(id, opts) return data end
ruby
def get_district_for_district_admin(id, opts = {}) data, _status_code, _headers = get_district_for_district_admin_with_http_info(id, opts) return data end
[ "def", "get_district_for_district_admin", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_district_for_district_admin_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns the district for a district admin @param id @param [Hash] opts the optional parameters @return [DistrictResponse]
[ "Returns", "the", "district", "for", "a", "district", "admin" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L629-L632
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_district_for_school
def get_district_for_school(id, opts = {}) data, _status_code, _headers = get_district_for_school_with_http_info(id, opts) return data end
ruby
def get_district_for_school(id, opts = {}) data, _status_code, _headers = get_district_for_school_with_http_info(id, opts) return data end
[ "def", "get_district_for_school", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_district_for_school_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns the district for a school @param id @param [Hash] opts the optional parameters @return [DistrictResponse]
[ "Returns", "the", "district", "for", "a", "school" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L682-L685
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_district_for_school_admin
def get_district_for_school_admin(id, opts = {}) data, _status_code, _headers = get_district_for_school_admin_with_http_info(id, opts) return data end
ruby
def get_district_for_school_admin(id, opts = {}) data, _status_code, _headers = get_district_for_school_admin_with_http_info(id, opts) return data end
[ "def", "get_district_for_school_admin", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_district_for_school_admin_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns the district for a school admin @param id @param [Hash] opts the optional parameters @return [DistrictResponse]
[ "Returns", "the", "district", "for", "a", "school", "admin" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L735-L738
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_district_for_section
def get_district_for_section(id, opts = {}) data, _status_code, _headers = get_district_for_section_with_http_info(id, opts) return data end
ruby
def get_district_for_section(id, opts = {}) data, _status_code, _headers = get_district_for_section_with_http_info(id, opts) return data end
[ "def", "get_district_for_section", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_district_for_section_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns the district for a section @param id @param [Hash] opts the optional parameters @return [DistrictResponse]
[ "Returns", "the", "district", "for", "a", "section" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L788-L791
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_district_for_student
def get_district_for_student(id, opts = {}) data, _status_code, _headers = get_district_for_student_with_http_info(id, opts) return data end
ruby
def get_district_for_student(id, opts = {}) data, _status_code, _headers = get_district_for_student_with_http_info(id, opts) return data end
[ "def", "get_district_for_student", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_district_for_student_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns the district for a student @param id @param [Hash] opts the optional parameters @return [DistrictResponse]
[ "Returns", "the", "district", "for", "a", "student" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L841-L844
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_district_for_teacher
def get_district_for_teacher(id, opts = {}) data, _status_code, _headers = get_district_for_teacher_with_http_info(id, opts) return data end
ruby
def get_district_for_teacher(id, opts = {}) data, _status_code, _headers = get_district_for_teacher_with_http_info(id, opts) return data end
[ "def", "get_district_for_teacher", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_district_for_teacher_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns the district for a teacher @param id @param [Hash] opts the optional parameters @return [DistrictResponse]
[ "Returns", "the", "district", "for", "a", "teacher" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L894-L897
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_district_for_term
def get_district_for_term(id, opts = {}) data, _status_code, _headers = get_district_for_term_with_http_info(id, opts) return data end
ruby
def get_district_for_term(id, opts = {}) data, _status_code, _headers = get_district_for_term_with_http_info(id, opts) return data end
[ "def", "get_district_for_term", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_district_for_term_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns the district for a term @param id @param [Hash] opts the optional parameters @return [DistrictResponse]
[ "Returns", "the", "district", "for", "a", "term" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L947-L950
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_school
def get_school(id, opts = {}) data, _status_code, _headers = get_school_with_http_info(id, opts) return data end
ruby
def get_school(id, opts = {}) data, _status_code, _headers = get_school_with_http_info(id, opts) return data end
[ "def", "get_school", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_school_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns a specific school @param id @param [Hash] opts the optional parameters @return [SchoolResponse]
[ "Returns", "a", "specific", "school" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L1047-L1050
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_school_admin
def get_school_admin(id, opts = {}) data, _status_code, _headers = get_school_admin_with_http_info(id, opts) return data end
ruby
def get_school_admin(id, opts = {}) data, _status_code, _headers = get_school_admin_with_http_info(id, opts) return data end
[ "def", "get_school_admin", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_school_admin_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns a specific school admin @param id @param [Hash] opts the optional parameters @return [SchoolAdminResponse]
[ "Returns", "a", "specific", "school", "admin" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L1100-L1103
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_school_for_section
def get_school_for_section(id, opts = {}) data, _status_code, _headers = get_school_for_section_with_http_info(id, opts) return data end
ruby
def get_school_for_section(id, opts = {}) data, _status_code, _headers = get_school_for_section_with_http_info(id, opts) return data end
[ "def", "get_school_for_section", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_school_for_section_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns the school for a section @param id @param [Hash] opts the optional parameters @return [SchoolResponse]
[ "Returns", "the", "school", "for", "a", "section" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L1209-L1212
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_school_for_student
def get_school_for_student(id, opts = {}) data, _status_code, _headers = get_school_for_student_with_http_info(id, opts) return data end
ruby
def get_school_for_student(id, opts = {}) data, _status_code, _headers = get_school_for_student_with_http_info(id, opts) return data end
[ "def", "get_school_for_student", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_school_for_student_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns the primary school for a student @param id @param [Hash] opts the optional parameters @return [SchoolResponse]
[ "Returns", "the", "primary", "school", "for", "a", "student" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L1262-L1265
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_school_for_teacher
def get_school_for_teacher(id, opts = {}) data, _status_code, _headers = get_school_for_teacher_with_http_info(id, opts) return data end
ruby
def get_school_for_teacher(id, opts = {}) data, _status_code, _headers = get_school_for_teacher_with_http_info(id, opts) return data end
[ "def", "get_school_for_teacher", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_school_for_teacher_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Retrieves school info for a teacher. @param id @param [Hash] opts the optional parameters @return [SchoolResponse]
[ "Retrieves", "school", "info", "for", "a", "teacher", "." ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L1315-L1318
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_schools_for_school_admin
def get_schools_for_school_admin(id, opts = {}) data, _status_code, _headers = get_schools_for_school_admin_with_http_info(id, opts) return data end
ruby
def get_schools_for_school_admin(id, opts = {}) data, _status_code, _headers = get_schools_for_school_admin_with_http_info(id, opts) return data end
[ "def", "get_schools_for_school_admin", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_schools_for_school_admin_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns the schools for a school admin @param id @param [Hash] opts the optional parameters @option opts [Integer] :limit @option opts [String] :starting_after @option opts [String] :ending_before @return [SchoolsResponse]
[ "Returns", "the", "schools", "for", "a", "school", "admin" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L1427-L1430
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_schools_for_student
def get_schools_for_student(id, opts = {}) data, _status_code, _headers = get_schools_for_student_with_http_info(id, opts) return data end
ruby
def get_schools_for_student(id, opts = {}) data, _status_code, _headers = get_schools_for_student_with_http_info(id, opts) return data end
[ "def", "get_schools_for_student", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_schools_for_student_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns the schools for a student @param id @param [Hash] opts the optional parameters @option opts [Integer] :limit @option opts [String] :starting_after @option opts [String] :ending_before @return [SchoolsResponse]
[ "Returns", "the", "schools", "for", "a", "student" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L1489-L1492
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_schools_for_teacher
def get_schools_for_teacher(id, opts = {}) data, _status_code, _headers = get_schools_for_teacher_with_http_info(id, opts) return data end
ruby
def get_schools_for_teacher(id, opts = {}) data, _status_code, _headers = get_schools_for_teacher_with_http_info(id, opts) return data end
[ "def", "get_schools_for_teacher", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_schools_for_teacher_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns the schools for a teacher @param id @param [Hash] opts the optional parameters @option opts [Integer] :limit @option opts [String] :starting_after @option opts [String] :ending_before @return [SchoolsResponse]
[ "Returns", "the", "schools", "for", "a", "teacher" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L1551-L1554
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_section
def get_section(id, opts = {}) data, _status_code, _headers = get_section_with_http_info(id, opts) return data end
ruby
def get_section(id, opts = {}) data, _status_code, _headers = get_section_with_http_info(id, opts) return data end
[ "def", "get_section", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_section_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns a specific section @param id @param [Hash] opts the optional parameters @return [SectionResponse]
[ "Returns", "a", "specific", "section" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L1610-L1613
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_sections_for_course
def get_sections_for_course(id, opts = {}) data, _status_code, _headers = get_sections_for_course_with_http_info(id, opts) return data end
ruby
def get_sections_for_course(id, opts = {}) data, _status_code, _headers = get_sections_for_course_with_http_info(id, opts) return data end
[ "def", "get_sections_for_course", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_sections_for_course_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns the sections for a Courses @param id @param [Hash] opts the optional parameters @option opts [Integer] :limit @option opts [String] :starting_after @option opts [String] :ending_before @return [SectionsResponse]
[ "Returns", "the", "sections", "for", "a", "Courses" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L1722-L1725
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_sections_for_school
def get_sections_for_school(id, opts = {}) data, _status_code, _headers = get_sections_for_school_with_http_info(id, opts) return data end
ruby
def get_sections_for_school(id, opts = {}) data, _status_code, _headers = get_sections_for_school_with_http_info(id, opts) return data end
[ "def", "get_sections_for_school", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_sections_for_school_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns the sections for a school @param id @param [Hash] opts the optional parameters @option opts [Integer] :limit @option opts [String] :starting_after @option opts [String] :ending_before @return [SectionsResponse]
[ "Returns", "the", "sections", "for", "a", "school" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L1784-L1787
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_sections_for_student
def get_sections_for_student(id, opts = {}) data, _status_code, _headers = get_sections_for_student_with_http_info(id, opts) return data end
ruby
def get_sections_for_student(id, opts = {}) data, _status_code, _headers = get_sections_for_student_with_http_info(id, opts) return data end
[ "def", "get_sections_for_student", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_sections_for_student_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns the sections for a student @param id @param [Hash] opts the optional parameters @option opts [Integer] :limit @option opts [String] :starting_after @option opts [String] :ending_before @return [SectionsResponse]
[ "Returns", "the", "sections", "for", "a", "student" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L1846-L1849
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_sections_for_teacher
def get_sections_for_teacher(id, opts = {}) data, _status_code, _headers = get_sections_for_teacher_with_http_info(id, opts) return data end
ruby
def get_sections_for_teacher(id, opts = {}) data, _status_code, _headers = get_sections_for_teacher_with_http_info(id, opts) return data end
[ "def", "get_sections_for_teacher", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_sections_for_teacher_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns the sections for a teacher @param id @param [Hash] opts the optional parameters @option opts [Integer] :limit @option opts [String] :starting_after @option opts [String] :ending_before @return [SectionsResponse]
[ "Returns", "the", "sections", "for", "a", "teacher" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L1908-L1911
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_sections_for_term
def get_sections_for_term(id, opts = {}) data, _status_code, _headers = get_sections_for_term_with_http_info(id, opts) return data end
ruby
def get_sections_for_term(id, opts = {}) data, _status_code, _headers = get_sections_for_term_with_http_info(id, opts) return data end
[ "def", "get_sections_for_term", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_sections_for_term_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns the sections for a term @param id @param [Hash] opts the optional parameters @option opts [Integer] :limit @option opts [String] :starting_after @option opts [String] :ending_before @return [SectionsResponse]
[ "Returns", "the", "sections", "for", "a", "term" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L1970-L1973
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_student
def get_student(id, opts = {}) data, _status_code, _headers = get_student_with_http_info(id, opts) return data end
ruby
def get_student(id, opts = {}) data, _status_code, _headers = get_student_with_http_info(id, opts) return data end
[ "def", "get_student", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_student_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns a specific student @param id @param [Hash] opts the optional parameters @return [StudentResponse]
[ "Returns", "a", "specific", "student" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L2029-L2032
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_students_for_contact
def get_students_for_contact(id, opts = {}) data, _status_code, _headers = get_students_for_contact_with_http_info(id, opts) return data end
ruby
def get_students_for_contact(id, opts = {}) data, _status_code, _headers = get_students_for_contact_with_http_info(id, opts) return data end
[ "def", "get_students_for_contact", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_students_for_contact_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns the students for a student contact @param id @param [Hash] opts the optional parameters @option opts [Integer] :limit @option opts [String] :starting_after @option opts [String] :ending_before @return [StudentsResponse]
[ "Returns", "the", "students", "for", "a", "student", "contact" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L2141-L2144
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_students_for_school
def get_students_for_school(id, opts = {}) data, _status_code, _headers = get_students_for_school_with_http_info(id, opts) return data end
ruby
def get_students_for_school(id, opts = {}) data, _status_code, _headers = get_students_for_school_with_http_info(id, opts) return data end
[ "def", "get_students_for_school", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_students_for_school_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns the students for a school @param id @param [Hash] opts the optional parameters @option opts [Integer] :limit @option opts [String] :starting_after @option opts [String] :ending_before @return [StudentsResponse]
[ "Returns", "the", "students", "for", "a", "school" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L2203-L2206
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_students_for_section
def get_students_for_section(id, opts = {}) data, _status_code, _headers = get_students_for_section_with_http_info(id, opts) return data end
ruby
def get_students_for_section(id, opts = {}) data, _status_code, _headers = get_students_for_section_with_http_info(id, opts) return data end
[ "def", "get_students_for_section", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_students_for_section_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns the students for a section @param id @param [Hash] opts the optional parameters @option opts [Integer] :limit @option opts [String] :starting_after @option opts [String] :ending_before @return [StudentsResponse]
[ "Returns", "the", "students", "for", "a", "section" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L2265-L2268
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_students_for_teacher
def get_students_for_teacher(id, opts = {}) data, _status_code, _headers = get_students_for_teacher_with_http_info(id, opts) return data end
ruby
def get_students_for_teacher(id, opts = {}) data, _status_code, _headers = get_students_for_teacher_with_http_info(id, opts) return data end
[ "def", "get_students_for_teacher", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_students_for_teacher_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns the students for a teacher @param id @param [Hash] opts the optional parameters @option opts [Integer] :limit @option opts [String] :starting_after @option opts [String] :ending_before @return [StudentsResponse]
[ "Returns", "the", "students", "for", "a", "teacher" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L2327-L2330
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_teacher
def get_teacher(id, opts = {}) data, _status_code, _headers = get_teacher_with_http_info(id, opts) return data end
ruby
def get_teacher(id, opts = {}) data, _status_code, _headers = get_teacher_with_http_info(id, opts) return data end
[ "def", "get_teacher", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_teacher_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns a specific teacher @param id @param [Hash] opts the optional parameters @return [TeacherResponse]
[ "Returns", "a", "specific", "teacher" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L2386-L2389
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_teacher_for_section
def get_teacher_for_section(id, opts = {}) data, _status_code, _headers = get_teacher_for_section_with_http_info(id, opts) return data end
ruby
def get_teacher_for_section(id, opts = {}) data, _status_code, _headers = get_teacher_for_section_with_http_info(id, opts) return data end
[ "def", "get_teacher_for_section", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_teacher_for_section_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns the primary teacher for a section @param id @param [Hash] opts the optional parameters @return [TeacherResponse]
[ "Returns", "the", "primary", "teacher", "for", "a", "section" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L2439-L2442
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_teachers_with_http_info
def get_teachers_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DataApi.get_teachers ..." end # resource path local_var_path = "/teachers" # query parameters query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'TeachersResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: DataApi#get_teachers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
ruby
def get_teachers_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DataApi.get_teachers ..." end # resource path local_var_path = "/teachers" # query parameters query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'TeachersResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: DataApi#get_teachers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
[ "def", "get_teachers_with_http_info", "(", "opts", "=", "{", "}", ")", "if", "@api_client", ".", "config", ".", "debugging", "@api_client", ".", "config", ".", "logger", ".", "debug", "\"Calling API: DataApi.get_teachers ...\"", "end", "local_var_path", "=", "\"/teachers\"", "query_params", "=", "{", "}", "query_params", "[", ":'", "'", "]", "=", "opts", "[", ":'", "'", "]", "if", "!", "opts", "[", ":'", "'", "]", ".", "nil?", "query_params", "[", ":'", "'", "]", "=", "opts", "[", ":'", "'", "]", "if", "!", "opts", "[", ":'", "'", "]", ".", "nil?", "query_params", "[", ":'", "'", "]", "=", "opts", "[", ":'", "'", "]", "if", "!", "opts", "[", ":'", "'", "]", ".", "nil?", "header_params", "=", "{", "}", "header_params", "[", "'Accept'", "]", "=", "@api_client", ".", "select_header_accept", "(", "[", "'application/json'", "]", ")", "form_params", "=", "{", "}", "post_body", "=", "nil", "auth_names", "=", "[", "'oauth'", "]", "data", ",", "status_code", ",", "headers", "=", "@api_client", ".", "call_api", "(", ":GET", ",", "local_var_path", ",", ":header_params", "=>", "header_params", ",", ":query_params", "=>", "query_params", ",", ":form_params", "=>", "form_params", ",", ":body", "=>", "post_body", ",", ":auth_names", "=>", "auth_names", ",", ":return_type", "=>", "'TeachersResponse'", ")", "if", "@api_client", ".", "config", ".", "debugging", "@api_client", ".", "config", ".", "logger", ".", "debug", "\"API called: DataApi#get_teachers\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"", "end", "return", "data", ",", "status_code", ",", "headers", "end" ]
Returns a list of teachers @param [Hash] opts the optional parameters @option opts [Integer] :limit @option opts [String] :starting_after @option opts [String] :ending_before @return [Array<(TeachersResponse, Fixnum, Hash)>] TeachersResponse data, response status code and response headers
[ "Returns", "a", "list", "of", "teachers" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L2506-L2541
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_teachers_for_school
def get_teachers_for_school(id, opts = {}) data, _status_code, _headers = get_teachers_for_school_with_http_info(id, opts) return data end
ruby
def get_teachers_for_school(id, opts = {}) data, _status_code, _headers = get_teachers_for_school_with_http_info(id, opts) return data end
[ "def", "get_teachers_for_school", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_teachers_for_school_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns the teachers for a school @param id @param [Hash] opts the optional parameters @option opts [Integer] :limit @option opts [String] :starting_after @option opts [String] :ending_before @return [TeachersResponse]
[ "Returns", "the", "teachers", "for", "a", "school" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L2551-L2554
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_teachers_for_section
def get_teachers_for_section(id, opts = {}) data, _status_code, _headers = get_teachers_for_section_with_http_info(id, opts) return data end
ruby
def get_teachers_for_section(id, opts = {}) data, _status_code, _headers = get_teachers_for_section_with_http_info(id, opts) return data end
[ "def", "get_teachers_for_section", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_teachers_for_section_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns the teachers for a section @param id @param [Hash] opts the optional parameters @option opts [Integer] :limit @option opts [String] :starting_after @option opts [String] :ending_before @return [TeachersResponse]
[ "Returns", "the", "teachers", "for", "a", "section" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L2613-L2616
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_teachers_for_student
def get_teachers_for_student(id, opts = {}) data, _status_code, _headers = get_teachers_for_student_with_http_info(id, opts) return data end
ruby
def get_teachers_for_student(id, opts = {}) data, _status_code, _headers = get_teachers_for_student_with_http_info(id, opts) return data end
[ "def", "get_teachers_for_student", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_teachers_for_student_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns the teachers for a student @param id @param [Hash] opts the optional parameters @option opts [Integer] :limit @option opts [String] :starting_after @option opts [String] :ending_before @return [TeachersResponse]
[ "Returns", "the", "teachers", "for", "a", "student" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L2675-L2678
train
Clever/clever-ruby
lib/clever-ruby/api/data_api.rb
Clever.DataApi.get_term
def get_term(id, opts = {}) data, _status_code, _headers = get_term_with_http_info(id, opts) return data end
ruby
def get_term(id, opts = {}) data, _status_code, _headers = get_term_with_http_info(id, opts) return data end
[ "def", "get_term", "(", "id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "get_term_with_http_info", "(", "id", ",", "opts", ")", "return", "data", "end" ]
Returns a specific term @param id @param [Hash] opts the optional parameters @return [TermResponse]
[ "Returns", "a", "specific", "term" ]
f9f19496c33699c4adfdebfbc7f118e75007b9e2
https://github.com/Clever/clever-ruby/blob/f9f19496c33699c4adfdebfbc7f118e75007b9e2/lib/clever-ruby/api/data_api.rb#L2734-L2737
train