class Beaver::PartnerServiceRbit
PartnerServiceRbit
Model.
Attributes
currency[RW]
TODO: Write general description for this method @return [CurrencyEnum]
modules_used[RW]
TODO: Write general description for this method @return [List of PartnerService]
service_monthly_cost[RW]
TODO: Write general description for this method @return [Integer]
service_name[RW]
TODO: Write general description for this method @return [String]
Public Class Methods
from_hash(hash)
click to toggle source
Creates an instance of the object from a hash.
# File lib/beaver/models/partner_service_rbit.rb, line 46 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. service_name = hash['service_name'] currency = hash['currency'] # Parameter is an array, so we need to iterate through it modules_used = nil unless hash['modules_used'].nil? modules_used = [] hash['modules_used'].each do |structure| modules_used << (PartnerService.from_hash(structure) if structure) end end service_monthly_cost = hash['service_monthly_cost'] # Create object from extracted values. PartnerServiceRbit.new(service_name, currency, modules_used, service_monthly_cost) end
names()
click to toggle source
A mapping from model property names to API property names.
# File lib/beaver/models/partner_service_rbit.rb, line 26 def self.names @_hash = {} if @_hash.nil? @_hash['currency'] = 'currency' @_hash['modules_used'] = 'modules_used' @_hash['service_monthly_cost'] = 'service_monthly_cost' @_hash['service_name'] = 'service_name' @_hash end
new(service_name = nil, currency = nil, modules_used = nil, service_monthly_cost = nil)
click to toggle source
# File lib/beaver/models/partner_service_rbit.rb, line 35 def initialize(service_name = nil, currency = nil, modules_used = nil, service_monthly_cost = nil) @currency = currency @modules_used = modules_used @service_monthly_cost = service_monthly_cost @service_name = service_name end