Class: Squib::Args::HandSpecial Private

Inherits:
Object
  • Object
show all
Includes:
ArgLoader
Defined in:
lib/squib/args/hand_special.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ArgLoader

#[], #convert_units, #defaultify, #expand_and_set_and_defaultify, #expandable_singleton?, #load!, #prep_layout_args, #validate

Constructor Details

#initialize(card_height) ⇒ HandSpecial

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of HandSpecial


10
11
12
# File 'lib/squib/args/hand_special.rb', line 10

def initialize(card_height)
  @card_height = card_height
end

Class Method Details

.expanding_parametersObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


21
22
23
# File 'lib/squib/args/hand_special.rb', line 21

def self.expanding_parameters
  [] # none of them
end

.parametersObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


14
15
16
17
18
19
# File 'lib/squib/args/hand_special.rb', line 14

def self.parameters
  {
    angle_range: (Math::PI / -4.0)..(Math::PI / 4),
    radius: :auto
  }
end

.params_with_unitsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


25
26
27
# File 'lib/squib/args/hand_special.rb', line 25

def self.params_with_units
  [ :radius ]
end

Instance Method Details

#validate_radius(arg) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


29
30
31
32
# File 'lib/squib/args/hand_special.rb', line 29

def validate_radius(arg)
  return 0.3 * @card_height if arg.to_s.downcase.strip == 'auto'
  arg
end