Class: CardDB::FieldInfo

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

Overview

Wrapper for FieldInfo

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ FieldInfo

Returns a new instance of FieldInfo.



601
602
603
# File 'lib/carddb/collection.rb', line 601

def initialize(data)
  @data = data || {}
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



599
600
601
# File 'lib/carddb/collection.rb', line 599

def data
  @data
end

Instance Method Details

#allowed_valuesObject



649
650
651
# File 'lib/carddb/collection.rb', line 649

def allowed_values
  data['allowedValues']
end

#descriptionObject



613
614
615
# File 'lib/carddb/collection.rb', line 613

def description
  data['description']
end

#display_formatObject



641
642
643
# File 'lib/carddb/collection.rb', line 641

def display_format
  data['displayFormat']
end

#filterable?Boolean

Returns:

  • (Boolean)


625
626
627
# File 'lib/carddb/collection.rb', line 625

def filterable?
  data['filterable']
end

#identifier?Boolean

Returns:

  • (Boolean)


633
634
635
# File 'lib/carddb/collection.rb', line 633

def identifier?
  data['isIdentifier']
end

#item_typeObject



637
638
639
# File 'lib/carddb/collection.rb', line 637

def item_type
  data['itemType']
end

#keyObject



605
606
607
# File 'lib/carddb/collection.rb', line 605

def key
  data['key']
end

#labelObject



609
610
611
# File 'lib/carddb/collection.rb', line 609

def label
  data['label']
end

#nested_fieldsObject



653
654
655
# File 'lib/carddb/collection.rb', line 653

def nested_fields
  @nested_fields ||= (data['nestedFields'] || []).map { |f| FieldInfo.new(f) }
end

#required?Boolean

Returns:

  • (Boolean)


621
622
623
# File 'lib/carddb/collection.rb', line 621

def required?
  data['isRequired']
end

#searchable?Boolean

Returns:

  • (Boolean)


629
630
631
# File 'lib/carddb/collection.rb', line 629

def searchable?
  data['searchable']
end

#semantic_typeObject



645
646
647
# File 'lib/carddb/collection.rb', line 645

def semantic_type
  data['semanticType']
end

#typeObject



617
618
619
# File 'lib/carddb/collection.rb', line 617

def type
  data['type']
end