Class: Cleon::Model

Inherits:
Object
  • Object
show all
Defined in:
lib/cleon/model.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Model

Returns a new instance of Model.

Parameters:

  • args (Array<String>)

    where the first item is model name and the rest are its attributes


23
24
25
26
# File 'lib/cleon/model.rb', line 23

def initialize(*args)
  @name, *params = GuardStringArray.(*args)
  @params = params.map{|pa| Param.new(pa)}
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.


18
19
20
# File 'lib/cleon/model.rb', line 18

def name
  @name
end

#paramsObject (readonly)

Returns the value of attribute params.


19
20
21
# File 'lib/cleon/model.rb', line 19

def params
  @params
end