class AelTracker::Bill

Attributes

id[RW]

Public Class Methods

new(bill_id) click to toggle source
# File lib/ael_tracker/bill.rb, line 13
def initialize(bill_id)
  self.id = bill_id
end

Public Instance Methods

method_missing(name, *args, &block) click to toggle source
Calls superclass method
# File lib/ael_tracker/bill.rb, line 21
def method_missing(name, *args, &block)
  if profile.has_key?(name.to_s)
    profile[name.to_s]
  else
    super
    # "Hey there, #{name} is not an attribute of bill in our records."
  end
end
profile() click to toggle source
# File lib/ael_tracker/bill.rb, line 17
def profile
  @profile ||= get_profile
end

Private Instance Methods

get_profile() click to toggle source
# File lib/ael_tracker/bill.rb, line 32
def get_profile
  a = self.class.get "/bills/#{self.id}"
  JSON.parse( a.parsed_response )
end