Class: Endymion::KindSpec
- Inherits:
-
Object
- Object
- Endymion::KindSpec
- Defined in:
- lib/endymion/kind_spec.rb
Instance Attribute Summary collapse
-
#api ⇒ Object
readonly
Returns the value of attribute api.
-
#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, api) ⇒ KindSpec
constructor
A new instance of KindSpec.
Constructor Details
#initialize(kind, api) ⇒ KindSpec
8 9 10 11 12 |
# File 'lib/endymion/kind_spec.rb', line 8 def initialize(kind, api) @kind = kind @fields = {} @api = api end |
Instance Attribute Details
#api ⇒ Object (readonly)
Returns the value of attribute api.
6 7 8 |
# File 'lib/endymion/kind_spec.rb', line 6 def api @api end |
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
6 7 8 |
# File 'lib/endymion/kind_spec.rb', line 6 def fields @fields end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
6 7 8 |
# File 'lib/endymion/kind_spec.rb', line 6 def kind @kind end |
Instance Method Details
#field(name, opts = {}) ⇒ Object
14 15 16 17 |
# File 'lib/endymion/kind_spec.rb', line 14 def field(name, opts={}) name = Format.format_field(name) @fields[name] = FieldSpec.new(name, opts.merge(api: api)) end |