Class: SparkApi::Models::FloPlan

Inherits:
Base
  • Object
show all
Extended by:
Subresource
Defined in:
lib/spark_api/models/floplan.rb

Constant Summary

Constants included from Paginate

Paginate::DEFAULT_PAGE_SIZE

Instance Attribute Summary collapse

Attributes inherited from Base

#attributes, #errors, #parent

Instance Method Summary collapse

Methods included from Subresource

build_subclass, find_by_id, find_by_listing_key, parse_date_start_and_end_times

Methods inherited from Base

#connection, connection, count, element_name, element_name=, first, get, #id, #load, #method_missing, #parse_id, path, #path, #persisted?, prefix, prefix=, #resource_pluralized, #resource_uri, #respond_to?, #to_param, #to_partial_path

Methods included from Paginate

#collect, #paginate, #per_page

Methods included from Dirty

#changed, #changed?, #changed_attributes, #changes, #dirty_attributes, #previous_changes

Constructor Details

#initialize(attributes = {}) ⇒ FloPlan

Returns a new instance of FloPlan.



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/spark_api/models/floplan.rb', line 9

def initialize(attributes={})
  @images = []
  @thumbnails = []

  attributes['Images'].each do |img|
    if img["Type"].include?('thumbnail')
      @thumbnails << img
    else
      @images << img
    end
  end
  super(attributes)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class SparkApi::Models::Base

Instance Attribute Details

#imagesObject

Returns the value of attribute images.



7
8
9
# File 'lib/spark_api/models/floplan.rb', line 7

def images
  @images
end

#thumbnailsObject

Returns the value of attribute thumbnails.



7
8
9
# File 'lib/spark_api/models/floplan.rb', line 7

def thumbnails
  @thumbnails
end