Class: Cadenya::Types::Account

Inherits:
Object
  • Object
show all
Defined in:
lib/cadenya/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(metadata: nil, spec: nil, info: nil) ⇒ Account

Returns a new instance of Account.



198
199
200
201
202
# File 'lib/cadenya/types.rb', line 198

def initialize(metadata: nil, spec: nil, info: nil)
  @metadata = 
  @spec = spec
  @info = info
end

Instance Attribute Details

#infoObject (readonly)

Returns the value of attribute info.



196
197
198
# File 'lib/cadenya/types.rb', line 196

def info
  @info
end

#metadataObject (readonly)

Returns the value of attribute metadata.



196
197
198
# File 'lib/cadenya/types.rb', line 196

def 
  @metadata
end

#specObject (readonly)

Returns the value of attribute spec.



196
197
198
# File 'lib/cadenya/types.rb', line 196

def spec
  @spec
end

Class Method Details

.from_json(data) ⇒ Object



204
205
206
207
208
209
210
# File 'lib/cadenya/types.rb', line 204

def self.from_json(data)
  new(
    metadata: data["metadata"].nil? ? nil : Types::AccountResourceMetadata.from_json(data["metadata"]),
    spec: data["spec"].nil? ? nil : Types::AccountSpec.from_json(data["spec"]),
    info: data["info"].nil? ? nil : Types::AccountInfo.from_json(data["info"]),
  )
end

Instance Method Details

#to_hObject



212
213
214
215
216
217
218
# File 'lib/cadenya/types.rb', line 212

def to_h
  {
    metadata: Util.plain(@metadata),
    spec: Util.plain(@spec),
    info: Util.plain(@info),
  }.reject { |_k, v| v.nil? }
end