Module: ProviderKit::Attribute
- Extended by:
- ActiveSupport::Concern
- Included in:
- Provideable
- Defined in:
- lib/provider_kit/attribute.rb
Overview
serialized attribute for provider
Instance Method Summary collapse
Instance Method Details
#provider ⇒ Object
9 10 11 12 13 |
# File 'lib/provider_kit/attribute.rb', line 9 def provider if provider_key.present? @provider ||= ProviderKit::ProviderAttribute.new(provider_key, record: self) end end |
#provider=(value) ⇒ Object
15 16 17 18 19 |
# File 'lib/provider_kit/attribute.rb', line 15 def provider=(value) @provider = nil write_attribute(:provider, value.to_s.presence) end |
#provider_key ⇒ Object
21 22 23 |
# File 'lib/provider_kit/attribute.rb', line 21 def provider_key read_attribute(:provider).to_s.presence end |