Module: Histock::Fetch::Profitability

Included in:
Histock::Fetch
Defined in:
lib/histock/simplefilter/fetch/profitability.rb

Instance Method Summary collapse

Instance Method Details

#income_rate(code, period) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/histock/simplefilter/fetch/profitability.rb', line 9

def income_rate(code, period)
    case period
    when 'month' then params = {:no => code, :t => 3, :st => 2, :q => 1}
    when 'quarter' then params = {:no => code, :t => 3, :st => 2, :q => 2}
    when 'year' then params = {:no => code, :t => 3, :st => 2, :q => 3}
    else raise ArgumentError
    end

    parse(:query => __method__, :html => get('/financial.aspx', params))
end

#profit_ratio(code) ⇒ Object



4
5
6
7
# File 'lib/histock/simplefilter/fetch/profitability.rb', line 4

def profit_ratio(code)
    params = {:no => code, :t => 3, :st => 1}
    parse(:query => __method__, :html => get('/financial.aspx', params))
end