Sha256: 428f8cc4e8b42b3640707799144137066c15f99691fdebde850b3326258d7e38
Contents?: true
Size: 793 Bytes
Versions: 17
Compression:
Stored size: 793 Bytes
Contents
# frozen_string_literal: true module IronBank # Metadata to provide accessors to Zuora resources. # module Metadata # Can be overriden to exclude specific fields for a given resource, see # `Account` class for an example def exclude_fields [] end def fields return [] unless schema @fields ||= schema.fields.map(&:name) - exclude_fields end def query_fields return [] unless schema @query_fields ||= schema.query_fields - exclude_fields end def schema @schema ||= IronBank::Schema.for(object_name) end def with_schema fields.each do |field| field_name = IronBank::Utils.underscore(field).to_sym define_method(:"#{field_name}") { remote[field_name] } end end end end
Version data entries
17 entries across 17 versions & 1 rubygems