Class: Solrengine::Ui::NftGridComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Solrengine::Ui::NftGridComponent
- Defined in:
- app/components/solrengine/ui/nft_grid_component.rb
Instance Attribute Summary collapse
-
#empty_message ⇒ Object
readonly
Returns the value of attribute empty_message.
-
#nfts ⇒ Object
readonly
Returns the value of attribute nfts.
Instance Method Summary collapse
- #empty? ⇒ Boolean
-
#initialize(nfts:, empty_message: "No NFTs in this wallet yet") ⇒ NftGridComponent
constructor
nfts: array of { id:, name:, image:, collection:, compressed: } (the shape returned by Solrengine::Tokens::Portfolio#nfts).
Constructor Details
#initialize(nfts:, empty_message: "No NFTs in this wallet yet") ⇒ NftGridComponent
nfts: array of { id:, name:, image:, collection:, compressed: } (the shape returned by Solrengine::Tokens::Portfolio#nfts)
10 11 12 13 |
# File 'app/components/solrengine/ui/nft_grid_component.rb', line 10 def initialize(nfts:, empty_message: "No NFTs in this wallet yet") @nfts = nfts || [] @empty_message = end |
Instance Attribute Details
#empty_message ⇒ Object (readonly)
Returns the value of attribute empty_message.
6 7 8 |
# File 'app/components/solrengine/ui/nft_grid_component.rb', line 6 def @empty_message end |
#nfts ⇒ Object (readonly)
Returns the value of attribute nfts.
6 7 8 |
# File 'app/components/solrengine/ui/nft_grid_component.rb', line 6 def nfts @nfts end |
Instance Method Details
#empty? ⇒ Boolean
15 16 17 |
# File 'app/components/solrengine/ui/nft_grid_component.rb', line 15 def empty? nfts.empty? end |