Class: FaithTeams::API::V2::Entity::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/faithteams/api/v2/entity/base.rb

Overview

Common entity functionality

Instance Method Summary collapse

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

Returns:

  • (Boolean)


21
22
23
# File 'lib/faithteams/api/v2/entity/base.rb', line 21

def saved?
  !!read_attribute(:id)
end

#to_hHash

Returns:

  • (Hash)


16
17
18
# File 'lib/faithteams/api/v2/entity/base.rb', line 16

def to_h
  attributes
end