Class: NftmakerApi::Client::Nfts

Inherits:
Object
  • Object
show all
Defined in:
lib/nftmaker_api/client/nfts.rb

Instance Method Summary collapse

Constructor Details

#initialize(client, project_id: nil) ⇒ Nfts

Returns a new instance of Nfts.



3
4
5
6
# File 'lib/nftmaker_api/client/nfts.rb', line 3

def initialize(client, project_id: nil)
  @client = client
  @project_id = project_id
end

Instance Method Details

#freeObject



13
14
15
# File 'lib/nftmaker_api/client/nfts.rb', line 13

def free
  list(state: :free)
end

#list(state: :all) ⇒ Object Also known as: all



8
9
10
# File 'lib/nftmaker_api/client/nfts.rb', line 8

def list(state: :all)
  @client.get "GetNfts/#{@client.api_key}/#{@project_id}/#{state}"
end

#reservedObject



17
18
19
# File 'lib/nftmaker_api/client/nfts.rb', line 17

def reserved
  list(state: :reserved)
end

#soldObject



21
22
23
# File 'lib/nftmaker_api/client/nfts.rb', line 21

def sold
  list(state: :sold)
end