class Beaver::FundraisingEvent

FundraisingEvent Model.

Attributes

campaign_category[RW]

TODO: Write general description for this method @return [String]

campaign_team[RW]

TODO: Write general description for this method @return [String]

currency[RW]

TODO: Write general description for this method @return [CurrencyEnum]

description[RW]

TODO: Write general description for this method @return [String]

event_time[RW]

TODO: Write general description for this method @return [Integer]

fundraising_goal[RW]

TODO: Write general description for this method @return [Integer]

giving_deadline[RW]

TODO: Write general description for this method @return [Integer]

name[RW]

TODO: Write general description for this method @return [String]

photo_uris[RW]

TODO: Write general description for this method @return [List of String]

uri[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/fundraising_event.rb, line 88
def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  name = hash['name']
  currency = hash['currency']
  event_time = hash['event_time']
  fundraising_goal = hash['fundraising_goal']
  giving_deadline = hash['giving_deadline']
  uri = hash['uri']
  description = hash['description']
  photo_uris = hash['photo_uris']
  campaign_category = hash['campaign_category']
  campaign_team = hash['campaign_team']

  # Create object from extracted values.
  FundraisingEvent.new(name,
                       currency,
                       event_time,
                       fundraising_goal,
                       giving_deadline,
                       uri,
                       description,
                       photo_uris,
                       campaign_category,
                       campaign_team)
end
names() click to toggle source

A mapping from model property names to API property names.

# File lib/beaver/models/fundraising_event.rb, line 50
def self.names
  @_hash = {} if @_hash.nil?
  @_hash['currency'] = 'currency'
  @_hash['event_time'] = 'event_time'
  @_hash['fundraising_goal'] = 'fundraising_goal'
  @_hash['giving_deadline'] = 'giving_deadline'
  @_hash['name'] = 'name'
  @_hash['uri'] = 'uri'
  @_hash['description'] = 'description'
  @_hash['photo_uris'] = 'photo_uris'
  @_hash['campaign_category'] = 'campaign_category'
  @_hash['campaign_team'] = 'campaign_team'
  @_hash
end
new(name = nil, currency = nil, event_time = nil, fundraising_goal = nil, giving_deadline = nil, uri = nil, description = nil, photo_uris = nil, campaign_category = nil, campaign_team = nil) click to toggle source
# File lib/beaver/models/fundraising_event.rb, line 65
def initialize(name = nil,
               currency = nil,
               event_time = nil,
               fundraising_goal = nil,
               giving_deadline = nil,
               uri = nil,
               description = nil,
               photo_uris = nil,
               campaign_category = nil,
               campaign_team = nil)
  @currency = currency
  @event_time = event_time
  @fundraising_goal = fundraising_goal
  @giving_deadline = giving_deadline
  @name = name
  @uri = uri
  @description = description
  @photo_uris = photo_uris
  @campaign_category = campaign_category
  @campaign_team = campaign_team
end