This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Example | |
| def make_method(&block) | |
| line_no = __LINE__; method_defs = %{ | |
| def dynamic_method | |
| #{block}.call(1) | |
| end | |
| } | |
| instance_eval method_defs, __FILE__, line_no |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Nokoquery | |
| module DSL | |
| module Item | |
| def item(name, *args, **options, &block) | |
| modulizer = Nokoquery::Modulizer.new(module_type: 'Item', name: name, klass: self) | |
| method_module = modulizer.module_for | |
| mod_name = modulizer.module_name | |
| method_module.class_variable_set(:"@@_#{mod_name}_#{name}_block_capture", block) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # See https://github.com/phstc/shoryuken/wiki/Creating-a-queue | |
| namespace :queues do | |
| desc "List all SQS queues" | |
| task :list => :environment do | |
| queues.each { |queue_url| puts queue_url } | |
| end | |
| desc "Get details for a specific SQS Queue" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class InstallPromptEngine < ActiveRecord::Migration[8.0] | |
| def change | |
| create_table :prompt_engine_settings do |t| | |
| # Encrypted API keys | |
| t.text :openai_api_key | |
| t.text :anthropic_api_key | |
| # Other settings can be added here in the future | |
| t.json :preferences | |
| t.timestamps | |
| end |
OlderNewer