Class: Hyperion::KindSpec

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(kind) ⇒ KindSpec

Returns a new instance of KindSpec.



295
296
297
298
# File 'lib/hyperion.rb', line 295

def initialize(kind)
  @kind = kind
  @fields = {}
end

Instance Attribute Details

#fieldsObject (readonly)

Returns the value of attribute fields.



293
294
295
# File 'lib/hyperion.rb', line 293

def fields
  @fields
end

#kindObject (readonly)

Returns the value of attribute kind.



293
294
295
# File 'lib/hyperion.rb', line 293

def kind
  @kind
end

Instance Method Details

#field(name, opts = {}) ⇒ Object



300
301
302
303
# File 'lib/hyperion.rb', line 300

def field(name, opts={})
  name = Format.format_field(name)
  @fields[name] = FieldSpec.new(name, opts)
end