Last active
December 23, 2015 22:49
-
-
Save dpmccabe/6706298 to your computer and use it in GitHub Desktop.
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 Billing < OtherClass | |
| extend ActiveModel::Naming | |
| include ActiveModel::Conversion | |
| include ActiveModel::Validations | |
| attr_accessor :save_my_billing | |
| attr_reader :result | |
| cattr_reader :rate | |
| @@rate = 0.03 | |
| def initialize(args = {}) | |
| args.each { |key, val| send("@#{key}=", val) } | |
| end | |
| def charge_for(item) | |
| # ... | |
| log_result | |
| end | |
| def reset! | |
| # ... | |
| end | |
| def self.send_billing_report | |
| # ... | |
| end | |
| protected | |
| def charge_custom(item) | |
| # ... | |
| log_result | |
| end | |
| private | |
| def log_result | |
| Transaction.create_from_result(result) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment