Class: Hyperion::KindSpec
- Inherits:
-
Object
- Object
- Hyperion::KindSpec
- Defined in:
- lib/hyperion.rb
Instance Attribute Summary collapse
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
Instance Method Summary collapse
- #field(name, opts = {}) ⇒ Object
-
#initialize(kind) ⇒ KindSpec
constructor
A new instance of KindSpec.
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
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
306 307 308 |
# File 'lib/hyperion.rb', line 306 def fields @fields end |
#kind ⇒ Object (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 |