Class: TrangeFrange::Member

Inherits:
Struct
  • Object
show all
Defined in:
lib/trange_frange/member.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#baseObject

Returns the value of attribute base

Returns:

  • (Object)

    the current value of base



4
5
6
# File 'lib/trange_frange/member.rb', line 4

def base
  @base
end

Instance Method Details

#hundredObject



13
14
15
# File 'lib/trange_frange/member.rb', line 13

def hundred
  base.size == 3 ? base[-3] : '0'
end

#oneObject



5
6
7
# File 'lib/trange_frange/member.rb', line 5

def one
  base[-1]
end

#tenObject



9
10
11
# File 'lib/trange_frange/member.rb', line 9

def ten
  base.size >= 2 ? base[-2] : '0'
end