Sha256: d63259bd5940077f185c0b37d8ed697e95b9d0b8fe03b6a985e9690d4bbf3d02

Contents?: true

Size: 527 Bytes

Versions: 6

Compression:

Stored size: 527 Bytes

Contents

module Rockstar
  class Chart < Base
    class << self
      def new_from_xml(xml, doc)
        Chart.new(xml['from'], xml['to'])
      end
    end
    def initialize(from, to)
      raise ArgumentError, "From is required" if from.blank?
      raise ArgumentError, "To is required" if to.blank?
      @from = from
      @to = to
    end

    def from=(value)
      @from = value.to_i
    end

    def to=(value)
      @to = value.to_i
    end

    def from
      @from.to_i
    end

    def to
      @to.to_i
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
rockstar-0.8.1 lib/rockstar/chart.rb
rockstar-0.8.0 lib/rockstar/chart.rb
jonaustin-rockstar-0.7.1 lib/rockstar/chart.rb
rockstar-0.7.1 lib/rockstar/chart.rb
rockstar-0.7.0 lib/rockstar/chart.rb
rockstar-0.6.4 lib/rockstar/chart.rb