Module: Chargify::Behaviors::Metafield
- Included in:
- CustomerMetafield, SubscriptionMetafield
- Defined in:
- lib/chargify_api_ares/behaviors/metafield.rb
Instance Method Summary collapse
- #on_csv_export=(value) ⇒ Object
- #on_csv_export? ⇒ Boolean
- #on_hosted_pages ⇒ Object
- #on_hosted_pages=(*products) ⇒ Object
- #on_hosted_pages? ⇒ Boolean
- #reload ⇒ Object
Instance Method Details
#on_csv_export=(value) ⇒ Object
8 9 10 11 |
# File 'lib/chargify_api_ares/behaviors/metafield.rb', line 8 def on_csv_export=(value) value = (value == true || value == '1') ? '1' : '0' scope.csv = value end |
#on_csv_export? ⇒ Boolean
4 5 6 |
# File 'lib/chargify_api_ares/behaviors/metafield.rb', line 4 def on_csv_export? scope.csv == "1" || scope.csv == true end |
#on_hosted_pages ⇒ Object
21 22 23 |
# File 'lib/chargify_api_ares/behaviors/metafield.rb', line 21 def on_hosted_pages scope.hosted end |
#on_hosted_pages=(*products) ⇒ Object
17 18 19 |
# File 'lib/chargify_api_ares/behaviors/metafield.rb', line 17 def on_hosted_pages=(*products) scope.hosted = Array(products).flatten.map(&:to_s) end |
#on_hosted_pages? ⇒ Boolean
13 14 15 |
# File 'lib/chargify_api_ares/behaviors/metafield.rb', line 13 def on_hosted_pages? scope.hosted.any? end |
#reload ⇒ Object
25 26 27 |
# File 'lib/chargify_api_ares/behaviors/metafield.rb', line 25 def reload raise NotImplementedError, 'Metafields do not support loading of a single record' end |