Module: Cub

Defined in:
lib/cub.rb,
lib/cub/version.rb

Defined Under Namespace

Classes: CompanyException

Constant Summary collapse

VERSION =
"0.0.4"
@@companies =
YAML.load_file(File.dirname(__FILE__) + '/../companies.yml')

Class Method Summary collapse

Class Method Details

.company(code) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/cub.rb', line 13

def self.company(code)
  if valid_code?(code)
    company_name(code)
  else
    raise CompanyException, "無効な証券コード"
  end
end

.pbr(code) ⇒ Object



37
38
39
40
41
42
43
# File 'lib/cub.rb', line 37

def self.pbr(code)
  if valid_code?(code)
     fetch_pbr(code)
  else
    raise CompanyException, "無効な証券コード"
  end
end

.per(code) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/cub.rb', line 29

def self.per(code)
  if valid_code?(code)
     fetch_per(code)
  else
    raise CompanyException, "無効な証券コード"
  end
end

.price(code) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/cub.rb', line 21

def self.price(code)
  if valid_code?(code)
     fetch_price(code)
  else
    raise CompanyException, "無効な証券コード"
  end
end