class Beaver::Payouts
Payouts
Model.
Attributes
current_issues[RW]
TODO: Write general description for this method @return [List of CurrentIssue]
enabled[RW]
TODO: Write general description for this method @return [Boolean]
upcoming_issues[RW]
TODO: Write general description for this method @return [Hash]
Public Class Methods
from_hash(hash)
click to toggle source
Creates an instance of the object from a hash.
# File lib/beaver/models/payouts.rb, line 39 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. enabled = hash['enabled'] # Parameter is an array, so we need to iterate through it current_issues = nil unless hash['current_issues'].nil? current_issues = [] hash['current_issues'].each do |structure| current_issues << (CurrentIssue.from_hash(structure) if structure) end end upcoming_issues = hash['upcoming_issues'] # Create object from extracted values. Payouts.new(enabled, current_issues, upcoming_issues) end
names()
click to toggle source
A mapping from model property names to API property names.
# File lib/beaver/models/payouts.rb, line 22 def self.names @_hash = {} if @_hash.nil? @_hash['current_issues'] = 'current_issues' @_hash['enabled'] = 'enabled' @_hash['upcoming_issues'] = 'upcoming_issues' @_hash end
new(enabled = nil, current_issues = nil, upcoming_issues = nil)
click to toggle source
# File lib/beaver/models/payouts.rb, line 30 def initialize(enabled = nil, current_issues = nil, upcoming_issues = nil) @current_issues = current_issues @enabled = enabled @upcoming_issues = upcoming_issues end