Class: Arrest::HasManyAttribute

Inherits:
Attribute show all
Defined in:
lib/arrest/attributes/has_many_attribute.rb

Direct Known Subclasses

HasManySubResourceAttribute

Instance Attribute Summary collapse

Attributes inherited from Attribute

#clazz, #json_name, #name, #read_only

Instance Method Summary collapse

Methods inherited from Attribute

#from_hash, #to_hash

Constructor Details

#initialize(ids_field_name, method_name, clazz_name, url_part, foreign_key, read_only = false) ⇒ HasManyAttribute

Returns a new instance of HasManyAttribute.



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/arrest/attributes/has_many_attribute.rb', line 5

def initialize(ids_field_name,
               method_name,
               clazz_name,
               url_part,
               foreign_key,
               read_only = false)
  super(ids_field_name, read_only, Array)
  @method_name = method_name.to_sym
  @clazz_name = clazz_name.to_sym
  @url_part = url_part.to_sym
  @foreign_key = foreign_key.to_sym
end

Instance Attribute Details

#clazz_nameObject (readonly)

Returns the value of attribute clazz_name.



4
5
6
# File 'lib/arrest/attributes/has_many_attribute.rb', line 4

def clazz_name
  @clazz_name
end

#foreign_keyObject (readonly)

Returns the value of attribute foreign_key.



4
5
6
# File 'lib/arrest/attributes/has_many_attribute.rb', line 4

def foreign_key
  @foreign_key
end

#method_nameObject (readonly)

Returns the value of attribute method_name.



4
5
6
# File 'lib/arrest/attributes/has_many_attribute.rb', line 4

def method_name
  @method_name
end

#url_partObject (readonly)

Returns the value of attribute url_part.



4
5
6
# File 'lib/arrest/attributes/has_many_attribute.rb', line 4

def url_part
  @url_part
end