Module: Fudo3

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

Defined Under Namespace

Classes: Error

Constant Summary collapse

TSUBO_BASE =
3.305785
JO_BASE =
1.6562
VERSION =
'0.2.8'

Class Method Summary collapse

Class Method Details

.heibei_to_jo(heibei) ⇒ Float

平米 → 畳 変換

Parameters:

  • heibei (Float)

    平米

Returns:

  • (Float)



21
22
23
# File 'lib/fudo3.rb', line 21

def self.heibei_to_jo(heibei)
  heibei.to_f / JO_BASE
end

.heibei_to_tsubo(heibei) ⇒ Float

平米 → 坪 変換

Parameters:

  • heibei (Float)

    平米

Returns:

  • (Float)



14
15
16
# File 'lib/fudo3.rb', line 14

def self.heibei_to_tsubo(heibei)
  heibei.to_f / TSUBO_BASE
end

.jo_to_heibei(jo) ⇒ Float

畳 → 平米 変換

Parameters:

  • jo (Float)

Returns:

  • (Float)

    平米



42
43
44
# File 'lib/fudo3.rb', line 42

def self.jo_to_heibei(jo)
  jo.to_f * JO_BASE
end

.jo_to_tsubo(jo) ⇒ Float

畳 → 坪 変換

Parameters:

  • jo (Float)

Returns:

  • (Float)



49
50
51
# File 'lib/fudo3.rb', line 49

def self.jo_to_tsubo(jo)
  jo.to_f * JO_BASE / TSUBO_BASE
end

.price_per_heibei(price, heibei) ⇒ Float

平米単価

Parameters:

  • price (Float)

    価格(万円)

  • heibei (Float)

    平米

Returns:

  • (Float)

    平米単価



73
74
75
# File 'lib/fudo3.rb', line 73

def self.price_per_heibei(price, heibei)
  price.to_f / heibei
end

.price_per_tsubo(price, tsubo) ⇒ Float

坪単価

Parameters:

  • price (Float)

    価格(万円)

  • tsubo (Float)

Returns:

  • (Float)

    坪単価



65
66
67
# File 'lib/fudo3.rb', line 65

def self.price_per_tsubo(price, tsubo)
  price.to_f / tsubo
end

.to_heibei(length, width) ⇒ Float

平米 # @param [Float] width 横

Parameters:

  • length (Float)

Returns:

  • (Float)

    平米



57
58
59
# File 'lib/fudo3.rb', line 57

def self.to_heibei(length, width)
  length.to_f * width.to_f
end

.tsubo_to_heibei(tsubo) ⇒ Float

坪 → 平米 変換

Parameters:

  • tsubo (Float)

Returns:

  • (Float)

    平米



28
29
30
# File 'lib/fudo3.rb', line 28

def self.tsubo_to_heibei(tsubo)
  tsubo.to_f * TSUBO_BASE
end

.tsubo_to_jo(tsubo) ⇒ Float

坪 → 畳 変換

Parameters:

  • tsubo (Float)

Returns:

  • (Float)



35
36
37
# File 'lib/fudo3.rb', line 35

def self.tsubo_to_jo(tsubo)
  tsubo.to_f * TSUBO_BASE / JO_BASE
end