Class: Endymion::KindSpec

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#apiObject (readonly)

Returns the value of attribute api.



6
7
8
# File 'lib/endymion/kind_spec.rb', line 6

def api
  @api
end

#fieldsObject (readonly)

Returns the value of attribute fields.



6
7
8
# File 'lib/endymion/kind_spec.rb', line 6

def fields
  @fields
end

#kindObject (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