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.



308
309
310
311
# File 'lib/hyperion.rb', line 308

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

Instance Attribute Details

#fieldsObject (readonly)

Returns the value of attribute fields.



306
307
308
# File 'lib/hyperion.rb', line 306

def fields
  @fields
end

#kindObject (readonly)

Returns the value of attribute kind.



306
307
308
# File 'lib/hyperion.rb', line 306

def kind
  @kind
end

Instance Method Details

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



313
314
315
316
# File 'lib/hyperion.rb', line 313

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