Class: FaithTeams::API::V2::Entity::Base
- Inherits:
-
Object
- Object
- FaithTeams::API::V2::Entity::Base
- Defined in:
- lib/faithteams/api/v2/entity/base.rb
Overview
Common entity functionality
Direct Known Subclasses
Batch, Contribution, ContributionRecord, ContributionType, Fund, Person
Instance Method Summary collapse
-
#initialize(attributes:) ⇒ Base
constructor
New instance of the class.
- #saved? ⇒ Boolean
- #to_h ⇒ Hash
Constructor Details
#initialize(attributes:) ⇒ Base
New instance of the class.
11 12 13 |
# File 'lib/faithteams/api/v2/entity/base.rb', line 11 def initialize(attributes:) @attributes = attributes end |
Instance Method Details
#saved? ⇒ Boolean
21 22 23 |
# File 'lib/faithteams/api/v2/entity/base.rb', line 21 def saved? !!read_attribute(:id) end |
#to_h ⇒ Hash
16 17 18 |
# File 'lib/faithteams/api/v2/entity/base.rb', line 16 def to_h attributes end |