Class: MasterCard::API::Blockchain::Block

Inherits:
Core::Model::BaseObject
  • Object
show all
Includes:
Core::Model
Defined in:
lib/mastercard/api/blockchain/block.rb

Class Method Summary collapse

Class Method Details

.listByCriteria(criteria = nil) ⇒ Object



63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/mastercard/api/blockchain/block.rb', line 63

def self.listByCriteria(criteria = nil)
    #
    #List objects of type Block
    #
    #@param [Dict] criteria
    #@return Array [Block] object matching the criteria.
    #@raise [APIException] an exception from the response status

    if criteria.nil?
        return self.execute("391fbbb2-1734-402c-89d8-81591d4a9d92",Block.new)
    else
        return self.execute("391fbbb2-1734-402c-89d8-81591d4a9d92",Block.new(criteria))
    end
end

.read(id, criteria = nil) ⇒ Object



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/mastercard/api/blockchain/block.rb', line 85

def self.read(id, criteria = nil)
    #
    #Returns objects of type Block by id and optional criteria
    #@param [String] id
    #@param [Dict] criteria
    #@return [Block] object representing the response
    #@raise [APIException] an exception from the response status

    mapObj = Block.new
    if !(id.nil? || id.to_s.empty?)
      mapObj.set("id", id)
    end
    if !criteria.nil?
        if criteria.instance_of? RequestMap
          mapObj.setAll(criteria.getObject())
        else
          mapObj.setAll(criteria)
        end
    end

    return self.execute("91d1412c-c7f3-46a7-87d0-3da090cc281c",Block.new(mapObj))
end