class Uphold::Entities::BaseEntity
Public Class Methods
from_collection(entities, content_range)
click to toggle source
# File lib/uphold/entities/base_entity.rb, line 6 def self.from_collection(entities, content_range) total_size = (content_range && content_range.split('/')[1]) || entities.size items = entities.map { |entity| new(entity.to_h) } PaginatedCollection.new(items, total_size) end
new(attributes = {})
click to toggle source
Calls superclass method
# File lib/uphold/entities/base_entity.rb, line 13 def initialize(attributes = {}) super(Uphold::Helpers.underscored_hash(attributes)) end
Public Instance Methods
error?()
click to toggle source
# File lib/uphold/entities/base_entity.rb, line 17 def error? is_a?(Uphold::Entities::Error) end