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.



607
608
609
# File 'lib/carddb/collection.rb', line 607

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

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



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

def data
  @data
end

Instance Method Details

#allowed_valuesObject



655
656
657
# File 'lib/carddb/collection.rb', line 655

def allowed_values
  data['allowedValues']
end

#descriptionObject



619
620
621
# File 'lib/carddb/collection.rb', line 619

def description
  data['description']
end

#display_formatObject



647
648
649
# File 'lib/carddb/collection.rb', line 647

def display_format
  data['displayFormat']
end

#filterable?Boolean

Returns:

  • (Boolean)


631
632
633
# File 'lib/carddb/collection.rb', line 631

def filterable?
  data['filterable']
end

#identifier?Boolean

Returns:

  • (Boolean)


639
640
641
# File 'lib/carddb/collection.rb', line 639

def identifier?
  data['isIdentifier']
end

#item_typeObject



643
644
645
# File 'lib/carddb/collection.rb', line 643

def item_type
  data['itemType']
end

#keyObject



611
612
613
# File 'lib/carddb/collection.rb', line 611

def key
  data['key']
end

#labelObject



615
616
617
# File 'lib/carddb/collection.rb', line 615

def label
  data['label']
end

#nested_fieldsObject



659
660
661
# File 'lib/carddb/collection.rb', line 659

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

#required?Boolean

Returns:

  • (Boolean)


627
628
629
# File 'lib/carddb/collection.rb', line 627

def required?
  data['isRequired']
end

#searchable?Boolean

Returns:

  • (Boolean)


635
636
637
# File 'lib/carddb/collection.rb', line 635

def searchable?
  data['searchable']
end

#semantic_typeObject



651
652
653
# File 'lib/carddb/collection.rb', line 651

def semantic_type
  data['semanticType']
end

#typeObject



623
624
625
# File 'lib/carddb/collection.rb', line 623

def type
  data['type']
end