Sha256: be087d212ef1383738f90d9303e419cb3c6fed3edf6b798a0bfb7ce8684e9352
Contents?: true
Size: 985 Bytes
Versions: 3
Compression:
Stored size: 985 Bytes
Contents
module Loopiator module Models #https://www.loopia.se/api/domain_obj/ class Domain attr_accessor :domain, :paid, :registered, :renewal_status, :expiration_date, :reference_number, :unpaid_amount def initialize(hash) hash.symbolize_keys! self.domain = hash.fetch(:domain, "") self.paid = hash.fetch(:paid, 0).eql?(1) self.registered = hash.fetch(:registered, 0).eql?(1) self.renewal_status = hash.fetch(:renewal_status, "") self.expiration_date = hash.fetch(:expiration_date, "") self.reference_number = hash.fetch(:reference_no, "").to_s self.unpaid_amount = hash.fetch(:unpaid_amount, 0) end def paid? paid end def registered? registered end def needs_to_be_paid? (!paid? && unpaid_amount > 0) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
loopiator-0.4.2 | lib/loopiator/models/domain.rb |
loopiator-0.4.1 | lib/loopiator/models/domain.rb |
loopiator-0.4.0 | lib/loopiator/models/domain.rb |