Class: PagSeguro::PreApproval
- Inherits:
-
Object
- Object
- PagSeguro::PreApproval
- Extended by:
- ConvertFieldToDigit
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/pag_seguro/pre_approval.rb
Constant Summary collapse
- PERIOD_TYPES =
%w(weekly monthly bimonthly trimonthly semiannually yearly)
- DAYS_OF_WEEK =
%w(monday tuesday wednesday thursday friday saturday sunday)
- DATE_RANGE =
17856.hours
Instance Attribute Summary collapse
-
#amount_per_payment ⇒ Object
Returns the value of attribute amount_per_payment.
-
#day_of_month ⇒ Object
Returns the value of attribute day_of_month.
-
#day_of_week ⇒ Object
Returns the value of attribute day_of_week.
-
#day_of_year ⇒ Object
Returns the value of attribute day_of_year.
-
#details ⇒ Object
Returns the value of attribute details.
-
#final_date ⇒ Object
Returns the value of attribute final_date.
-
#initial_date ⇒ Object
Returns the value of attribute initial_date.
-
#max_amount_per_period ⇒ Object
Returns the value of attribute max_amount_per_period.
-
#max_total_amount ⇒ Object
Returns the value of attribute max_total_amount.
-
#name ⇒ Object
Returns the value of attribute name.
-
#period ⇒ Object
Returns the value of attribute period.
-
#review_URL ⇒ Object
Returns the value of attribute review_URL.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ PreApproval
constructor
A new instance of PreApproval.
- #monthly? ⇒ Boolean
- #weekly? ⇒ Boolean
- #yearly? ⇒ Boolean
Methods included from ConvertFieldToDigit
Constructor Details
#initialize(options = {}) ⇒ PreApproval
Returns a new instance of PreApproval.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/pag_seguro/pre_approval.rb', line 27 def initialize( = {}) @name = [:name] @details = [:details] @amount_per_payment = [:amount_per_payment] @period = [:period] @day_of_week = [:day_of_week] @day_of_month = [:day_of_month] @day_of_year = [:day_of_year] @initial_date = [:initial_date] @final_date = [:final_date] @max_amount_per_period = [:max_amount_per_period] @max_total_amount = [:max_total_amount] @review_URL = [:review_URL] end |
Instance Attribute Details
#amount_per_payment ⇒ Object
Returns the value of attribute amount_per_payment.
10 11 12 |
# File 'lib/pag_seguro/pre_approval.rb', line 10 def amount_per_payment @amount_per_payment end |
#day_of_month ⇒ Object
Returns the value of attribute day_of_month.
10 11 12 |
# File 'lib/pag_seguro/pre_approval.rb', line 10 def day_of_month @day_of_month end |
#day_of_week ⇒ Object
Returns the value of attribute day_of_week.
10 11 12 |
# File 'lib/pag_seguro/pre_approval.rb', line 10 def day_of_week @day_of_week end |
#day_of_year ⇒ Object
Returns the value of attribute day_of_year.
10 11 12 |
# File 'lib/pag_seguro/pre_approval.rb', line 10 def day_of_year @day_of_year end |
#details ⇒ Object
Returns the value of attribute details.
10 11 12 |
# File 'lib/pag_seguro/pre_approval.rb', line 10 def details @details end |
#final_date ⇒ Object
Returns the value of attribute final_date.
10 11 12 |
# File 'lib/pag_seguro/pre_approval.rb', line 10 def final_date @final_date end |
#initial_date ⇒ Object
Returns the value of attribute initial_date.
10 11 12 |
# File 'lib/pag_seguro/pre_approval.rb', line 10 def initial_date @initial_date end |
#max_amount_per_period ⇒ Object
Returns the value of attribute max_amount_per_period.
10 11 12 |
# File 'lib/pag_seguro/pre_approval.rb', line 10 def max_amount_per_period @max_amount_per_period end |
#max_total_amount ⇒ Object
Returns the value of attribute max_total_amount.
10 11 12 |
# File 'lib/pag_seguro/pre_approval.rb', line 10 def max_total_amount @max_total_amount end |
#name ⇒ Object
Returns the value of attribute name.
10 11 12 |
# File 'lib/pag_seguro/pre_approval.rb', line 10 def name @name end |
#period ⇒ Object
Returns the value of attribute period.
10 11 12 |
# File 'lib/pag_seguro/pre_approval.rb', line 10 def period @period end |
#review_URL ⇒ Object
Returns the value of attribute review_URL.
10 11 12 |
# File 'lib/pag_seguro/pre_approval.rb', line 10 def review_URL @review_URL end |
Instance Method Details
#monthly? ⇒ Boolean
66 67 68 |
# File 'lib/pag_seguro/pre_approval.rb', line 66 def monthly? %w(monthly bimonthly trimonthly).include? period end |
#weekly? ⇒ Boolean
62 63 64 |
# File 'lib/pag_seguro/pre_approval.rb', line 62 def weekly? period == 'weekly' end |
#yearly? ⇒ Boolean
70 71 72 |
# File 'lib/pag_seguro/pre_approval.rb', line 70 def yearly? period == 'yearly' end |