Class: Nova::API::Utils::BaseStruct
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- Nova::API::Utils::BaseStruct
- Extended by:
- Forwardable
- Defined in:
- lib/nova/api/utils/base_struct.rb
Direct Known Subclasses
Base, ListResponse, Resource::Bill::Apportionment, Resource::Bill::FinancialAccount, Resource::Card::Tax, Resource::DirectBill::Installment, Resource::Response::CurrentAssetStatement, Response, SearchParams::Apportionment, SearchParams::Bill, SearchParams::CurrentAsset, SearchParams::CurrentAssetStatement, SearchParams::ThirdParty
Constant Summary collapse
- DATE_REGEX =
/\A\d{4}-\d{2}-\d{2}\z/
Instance Method Summary collapse
Instance Method Details
#allowed_attributes ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/nova/api/utils/base_struct.rb', line 14 def allowed_attributes return attributes unless self.class.const_defined?('ALLOWED_ATTRIBUTES') data = {} self.class.const_get('ALLOWED_ATTRIBUTES').each do |key| next unless attributes.keys.include? key value = attributes[key] data[key.to_sym] = extract_value(key, value) end data end |