Class: JsonSchema::Artesano::Hand

Inherits:
Object
  • Object
show all
Defined in:
lib/json_schema/artesano/hand.rb

Constant Summary collapse

PRIMITIVE_MATERIALS =
%w{null boolean number string integer}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tool: Tools::Static) ⇒ Hand

Returns a new instance of Hand.



18
19
20
# File 'lib/json_schema/artesano/hand.rb', line 18

def initialize(tool: Tools::Static)
  self.use_tool(tool)
end

Instance Attribute Details

#toolObject (readonly)

Returns the value of attribute tool.



16
17
18
# File 'lib/json_schema/artesano/hand.rb', line 16

def tool
  @tool
end

Instance Method Details

#mold(sketch) ⇒ Object



26
27
28
# File 'lib/json_schema/artesano/hand.rb', line 26

def mold(sketch)
  transform( material(sketch) )
end

#use_tool(tool) ⇒ Object



22
23
24
# File 'lib/json_schema/artesano/hand.rb', line 22

def use_tool(tool)
  @tool = tool.new
end