class Beaver::Currencies2
Currencies2
Model.
Attributes
cad[RW]
TODO: Write general description for this method @return [CAD1]
gbp[RW]
TODO: Write general description for this method @return [GBP1]
usd[RW]
TODO: Write general description for this method @return [USD1]
Public Class Methods
from_hash(hash)
click to toggle source
Creates an instance of the object from a hash.
# File lib/beaver/models/currencies2.rb, line 39 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. usd = USD1.from_hash(hash['USD']) if hash['USD'] cad = CAD1.from_hash(hash['CAD']) if hash['CAD'] gbp = GBP1.from_hash(hash['GBP']) if hash['GBP'] # Create object from extracted values. Currencies2.new(usd, cad, gbp) end
names()
click to toggle source
A mapping from model property names to API property names.
# File lib/beaver/models/currencies2.rb, line 22 def self.names @_hash = {} if @_hash.nil? @_hash['usd'] = 'USD' @_hash['cad'] = 'CAD' @_hash['gbp'] = 'GBP' @_hash end
new(usd = nil, cad = nil, gbp = nil)
click to toggle source
# File lib/beaver/models/currencies2.rb, line 30 def initialize(usd = nil, cad = nil, gbp = nil) @usd = usd @cad = cad @gbp = gbp end