Module: Chargify::Behaviors::Metafield

Included in:
CustomerMetafield, SubscriptionMetafield
Defined in:
lib/chargify_api_ares/behaviors/metafield.rb

Instance Method Summary collapse

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

Returns:

  • (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_pagesObject



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

Returns:

  • (Boolean)


13
14
15
# File 'lib/chargify_api_ares/behaviors/metafield.rb', line 13

def on_hosted_pages?
  scope.hosted.any?
end

#reloadObject

Raises:

  • (NotImplementedError)


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